Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Core Data: undo and non-object attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: undo and non-object attribute

Undo/redo is operating on the primitive values stored by the NSManagedObject. You never set the primitive values for the x and y keys, so they are always nil as far as the undo manager is concerned.

I've tried adding [self setPrimitiveValue:[NSNumber numberWithDouble:value] forKey:@"x"] but it doesn't work anyway. Or perhaps you're suggesting that I should manage undo in my own setPrimitiveValue:forKey?
What exactly are you trying to achieve? Did you read the documentation about ivars in NSManagedObject?

The problem is that I'm using a C-Structure as ivar. CD doesn't seem to like it. In fact, docs report:

"If you choose to represent an attribute using a scalar type (such as int or float), or as one of the structures supported by NSKeyValueCoding (NSRect, NSPoint, NSSize, NSRange), then you should implement accessor methods as illustrated in Listing 2. If you want to use any other attribute type, then you should use a different pattern, described in Non-Standard Attributes."

But it's not clear for me.
Thank you, anyway
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

 >Core Data: undo and non-object attribute (From: Matteo Rossi <email@hidden>)
 >Re: Core Data: undo and non-object attribute (From: Jakob Olesen <email@hidden>)

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.