FROM : Michael Latta
DATE : Thu Mar 06 06:26:53 2008
Here are the accessor methods I use for the property:
- (NSData*)transform {
[self willAccessValueForKey:@"transform"];
NSData *result = [self primitiveValueForKey:@"transform"];
[self didAccessValueForKey:@"transform"];
return result;
}
- (void)setTransform:(NSData*)value_ {
[self willChangeValueForKey:@"transform"];
[self setPrimitiveValue:value_ forKey:@"transform"];
[self didChangeValueForKey:@"transform"];
}
These were generated by mogen. I will try to see what is up with the
managed object context notifications though.
The undo is by the user from the menu or keyboard. I do create some
undo groups to batch up related changes. The undo group logic was
lifted from an earlier application. If I fail to close a group would
that cause this? Are there things to worry about when mixing calls to
the undo manager and Core Data?
Michael
On Mar 5, 2008, at 7:53 PM, Ben Trumbull wrote:
> At 6:58 PM -0800 3/5/08, Michael Latta wrote:
>> The calls are on the Will/Did undo/redo notifications not the KVO
>> callbacks on object changes.
>
> Ah, okay. There shouldn't be any need to call -
> processPendingChanges there, unless you're programmatically working
> with your own undo groups.
>
>> What I am seeing is that my code changes a managed object property,
>> I undo, and no change occurs in the managed object. The property
>> affected is a binary attribute (a CATransform3D as bytes).
>
> Does your code changing the property trigger a KVO event (i.e. are
> you missing a call to -willChangeValueForKey:) ? Do you see
> notifications from the MOC when you initially make the change ?
>
> Are you undoing programmatically or as a user ?
>
>> The undo behaves the same as before I added any notification
>> processing however.
>
> That suggests the problem lies elsewhere.
> --
>
> -Ben
DATE : Thu Mar 06 06:26:53 2008
Here are the accessor methods I use for the property:
- (NSData*)transform {
[self willAccessValueForKey:@"transform"];
NSData *result = [self primitiveValueForKey:@"transform"];
[self didAccessValueForKey:@"transform"];
return result;
}
- (void)setTransform:(NSData*)value_ {
[self willChangeValueForKey:@"transform"];
[self setPrimitiveValue:value_ forKey:@"transform"];
[self didChangeValueForKey:@"transform"];
}
These were generated by mogen. I will try to see what is up with the
managed object context notifications though.
The undo is by the user from the menu or keyboard. I do create some
undo groups to batch up related changes. The undo group logic was
lifted from an earlier application. If I fail to close a group would
that cause this? Are there things to worry about when mixing calls to
the undo manager and Core Data?
Michael
On Mar 5, 2008, at 7:53 PM, Ben Trumbull wrote:
> At 6:58 PM -0800 3/5/08, Michael Latta wrote:
>> The calls are on the Will/Did undo/redo notifications not the KVO
>> callbacks on object changes.
>
> Ah, okay. There shouldn't be any need to call -
> processPendingChanges there, unless you're programmatically working
> with your own undo groups.
>
>> What I am seeing is that my code changes a managed object property,
>> I undo, and no change occurs in the managed object. The property
>> affected is a binary attribute (a CATransform3D as bytes).
>
> Does your code changing the property trigger a KVO event (i.e. are
> you missing a call to -willChangeValueForKey:) ? Do you see
> notifications from the MOC when you initially make the change ?
>
> Are you undoing programmatically or as a user ?
>
>> The undo behaves the same as before I added any notification
>> processing however.
>
> That suggests the problem lies elsewhere.
> --
>
> -Ben
| Related mails | Author | Date |
|---|---|---|
| Michael Latta | Mar 5, 05:31 | |
| Dave Fernandes | Mar 5, 05:45 | |
| Michael Latta | Mar 5, 05:55 | |
| Ben Trumbull | Mar 6, 03:31 | |
| Michael Latta | Mar 6, 03:58 | |
| Ben Trumbull | Mar 6, 04:53 | |
| Michael Latta | Mar 6, 06:26 | |
| Michael Latta | Mar 6, 06:31 | |
| Michael Latta | Mar 6, 06:41 |






Cocoa mail archive

