• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSArrayController (or NSObjectController) in Entity Mode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSArrayController (or NSObjectController) in Entity Mode
      • From: mmalc crawford <email@hidden>
    • Re: NSArrayController (or NSObjectController) in Entity Mode
      • From: "Clint Shryock" <email@hidden>
  • Prev by Date: Re: core data app questions - help!
  • Next by Date: Re: initializing ivars
  • Previous by thread: Re: my preferences sheet appears under XCode not under the app ...
  • Next by thread: Re: NSArrayController (or NSObjectController) in Entity Mode
  • Index(es):
    • Date
    • Thread