• 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
Re: Values set in awakeFromInsert have gone missing.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Values set in awakeFromInsert have gone missing.


  • Subject: Re: Values set in awakeFromInsert have gone missing.
  • From: Jim Correia <email@hidden>
  • Date: Sun, 29 Jul 2007 19:05:56 -0400

On Jul 29, 2007, at 4:15 PM, Mike Zornek wrote:

I've encountered a strange bug while implementing AppleScript support for my
Core Data app. The basic issue is values that are set in awakeFromInsert
are present at one point but when I later get the object from the MOC the
values aren't there. A more verbose demo is online:


http://mikezornek.com/temp/core_data_disapearing_values_bugs.mov

Mike,

It would help if you could further isolate the problem and post isolated snippets related to the problem.

I didn't watch the movie (12 minutes!?) but I did scrub to the end.

Your overridden -init in your NSManagedObject subclass is incorrect. Consider what you are doing:

- (id)init
{
	self = [NSEntityDescription insertNewObjectForEntityName: ... ];
	return self;
}

The object has already been allocated, and you are being sent the - init message for the object. You turn around, reassign self to an autoreleased object, and return that.

Fixing this problem is a necessary first step.

Jim


_______________________________________________

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


References: 
 >Values set in awakeFromInsert have gone missing. (From: Mike Zornek <email@hidden>)

  • Prev by Date: Re: NSLevelIndicator and mouse clicks
  • Next by Date: NSCommandKeyMask being ignored in NSView subclasses
  • Previous by thread: Values set in awakeFromInsert have gone missing.
  • Next by thread: Re: Values set in awakeFromInsert have gone missing.
  • Index(es):
    • Date
    • Thread