How to programmatically create an NSObjectController in Entity mode?
How to programmatically create an NSObjectController in Entity mode?
- Subject: How to programmatically create an NSObjectController in Entity mode?
- From: "Sean McBride" <email@hidden>
- Date: Tue, 29 Apr 2008 13:04:59 -0400
- Organization: Rogue Research
Hi all,
How does one programmatically create an NSObjectController in Entity
mode? I've tried all kinds of orderings of calls but can't get it do work.
1) the docs don't say what the designated initializer is. Is it
initWithContent? What should be passed as 'content'? Is nil acceptable?
2) I've tried:
myController = [[NSObjectController alloc] initWithContent:nil];
[myController setManagedObjectContext:[self managedObjectContext]];
[myController setEntityName:@"MyEntity"];
[myController setAutomaticallyPreparesContent:YES];
But when I do 'po' in gdb it reveals that it's in Object mode:
(gdb) po myController
<NSObjectController: 0x3a895a0>[object class: NSMutableDictionary]
An archive post suggests this is a bug in NSObjectController's
description, but I can't be sure. In any case, [myController content]
always gives nil.
What is the correct way to programmatically creates these things?
Thanks,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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