• 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
KVO Code Breaks Undo
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVO Code Breaks Undo


  • Subject: KVO Code Breaks Undo
  • From: Richard Somers <email@hidden>
  • Date: Sat, 28 Mar 2009 06:33:29 -0600

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];
}


Any ideas as to why undo stopped working?

Richard

_______________________________________________

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


  • Follow-Ups:
    • Re: KVO Code Breaks Undo
      • From: Tommy Nordgren <email@hidden>
    • Re: KVO Code Breaks Undo
      • From: Ken Thomases <email@hidden>
  • Prev by Date: re: Core Data: is fetching safe during validateForInsert:/validateForUpdate?
  • Next by Date: Finding the NSCollectionViewItem being represented from the view
  • Previous by thread: Re: Is there any ordered list or balanced tree
  • Next by thread: Re: KVO Code Breaks Undo
  • Index(es):
    • Date
    • Thread