Re: Core Data - awakeFromInsert
Re: Core Data - awakeFromInsert
- Subject: Re: Core Data - awakeFromInsert
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 4 Oct 2005 18:04:34 -0700
On Oct 4, 2005, at 4:43 PM, Jim Murry wrote:
I am trying to implement defaults by creating a core data object to
hold these defaults.
It's not clear why you're trying to do this (in this way)...
This way they do not reset to zero when the program is run from a
different user or a different machine as long as they have access
to the same core data file.
... you can establish "factory settings" (NSRegistrationDomain) for
user defaults much more easily (see <http://developer.apple.com/
documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/
NSUserDefaults.html#//apple_ref/doc/uid/20000318-CIHDDCDB>).
What are you actually trying to achieve?
[masterRecord willChangeValueForKey: @"recordID"];
[masterRecord setPrimitiveValue:[NSNumber numberWithLongLong:
(value + 1)] forKey:@"recordID"];
[masterRecord didChangeValueForKey: @"recordID"];
[self setPrimitiveValue:[NSNumber numberWithLongLong:(value)]
forKey:@"recordID"];
Don't do this!
Either use the standard KVO-compliant accessors or use the primitive
accessors. It's not clear what you're trying to achieve doing this,
or why.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden