I have a NSPopupButton that is bound to a CoreData backed NSArrayController.
I subclassed the NSArrayController to set a fetchLimit and SortDescriptor.
The problem is the following:
The FetchLimit only applies on the initial load. When entries are added to the CoreData Store programatically, the NSPopupButton reflects and shows the new entries, but does not apply the fetch limit. I also tried to set the merge: parameter to NO, but this开发者_StackOverflow中文版 doesn't seem to affect the updates/refetches.
- (BOOL) fetchWithRequest:(NSFetchRequest *)fetchRequest
merge:(BOOL)merge
error:(NSError **)error
{
if(fetchRequest)
[fetchRequest setFetchLimit:10];
NSLog(@"fetchWithRequest: %@", fetchRequest);
return [super fetchWithRequest:fetchRequest merge:NO error:error];
}
am i missing something?
精彩评论