Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController (or NSObjectController) in Entity Mode



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.