NSArrayController (or NSObjectController) in Entity Mode
NSArrayController (or NSObjectController) in Entity Mode
- Subject: NSArrayController (or NSObjectController) in Entity Mode
- From: Andrew Kimpton <email@hidden>
- Date: Sun, 02 Sep 2007 13:41:43 -0400
I'd like to programmatically create an NSArrayController that fetches
a specific entity from my Managed Object Context.
I'm using the following :
mFutureRecordingsArrayController = [[NSArrayController alloc] init];
[mFutureRecordingsArrayController setManagedObjectContext:[[NSApp
delegate] managedObjectContext]];
[mFutureRecordingsArrayController setEntityName:@"Schedule"];
However if I get the description of the
mFutureRecordingsArrayController in gdb it says :
Printing description of mFutureRecordingsArrayController:
<NSArrayController: 0x3ee2d0>[object class: NSMutableDictionary,
number of selected objects: 0]
However an object controller created in IB says :
Printing description of mCurrentSchedule:
<NSObjectController: 0x3541c0>[entity: Schedule]
An email thread from mmalc in February of this year
(http://lists.apple.com/archives/cocoa-dev/2007/Feb/msg01140.html)
suggests that the above should work fine (I've tried the
setManagedObjectContext/setEntityName calls in both the above order
and reversed with no change in results).
Is there some other (undocumented ?) set of messages I need to create
an NSArrayController in Entity Mode ? Or can it only be done through
IB ? Sure I can create the controller in IB and 'link it up' - but
shouldn't this be possible to do in code too ?
Andrew 8-)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden