• 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
How to programmatically create an NSObjectController in Entity mode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to programmatically create an NSObjectController in Entity mode?
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Any actor or coroutine implementations for Cocoa?
  • Next by Date: Re: How to programmatically create an NSObjectController in Entity mode?
  • Previous by thread: Re: Any actor or coroutine implementations for Cocoa?
  • Next by thread: Re: How to programmatically create an NSObjectController in Entity mode?
  • Index(es):
    • Date
    • Thread