• 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
SOLVED: Issues with Core Data, NSTreeController, and observedObject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SOLVED: Issues with Core Data, NSTreeController, and observedObject


  • Subject: SOLVED: Issues with Core Data, NSTreeController, and observedObject
  • From: Sam Stigler <email@hidden>
  • Date: Tue, 8 May 2007 16:52:57 +1000

Hello all,

I am unbelievably ecstatic right now that, after this problem bugging me for days, I finally figured out how to get [value observedObject] - type functionality working in a subclass of NSManagedObject. (Before, neither [value observedObject] nor [value valueForKey:@"observedObject"] had been working.) Here's the method I added to my subclass:

-(NSManagedObject *)observedObject {
	NSManagedObjectID *objID = [self objectID];
	NSManagedObjectContext *moc = [self managedObjectContext];
	id tmpObject = [moc objectWithID:objID];

	return tmpObject;
}

All of that was just based on a guess from reading the documentation, and I think I'd seen NSManagedObjectID in one of the NSTreeController categories out there. Now on to rest of the program...

-Sam
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Prev by Date: Accessing Text fields my cocoa app through AppleScripts
  • Next by Date: Re: Observing NSArrayController's content, shouldn't it be simple ?
  • Previous by thread: Re: Accessing Text fields my cocoa app through AppleScripts
  • Next by thread: How to convert pixels to centimeters in Cocoa
  • Index(es):
    • Date
    • Thread