On Mar 28, 2009, at 1:33 PM, Richard Somers wrote:

I have core data document based application with a custom opengl layer-hosting view. Everything works except when objects are added or removed from the managed object model the view is not redrawn. So I add the following to code to redraw the view but then automatic undo is broken.

// Receive KVO change notifications if objects are added to or removed
// from the array so we can redraw the display. !!!: Breaks undo!
- (void)awakeFromNib
{
[observableController addObserver:self forKeyPath:@"arrangedObjects" options:NSKeyValueObservingOptionNew context:NULL];
}


// Respond to KVO change notifications. !!!: Breaks undo!
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject: (id)object change:(NSDictionary *)change context:(void *)context
{
   [graphicsLayer setNeedsDisplay];
You need to invoke base class method; Otherwise the standard behaviour won't be used.

}

Any ideas as to why undo stopped working?

Richard

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/tommy.nordgren%40comhem.se

This email sent to tommy.nordg...@comhem.se

-----------------------------------
See the amazing new SF reel: Invasion of the man eating cucumbers from outer space. On congratulations for a fantastic parody, the producer replies : "What parody?"

Tommy Nordgren
tommy.nordg...@comhem.se




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to