• 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
Re: objectInXXXAtIndex: exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objectInXXXAtIndex: exception


  • Subject: Re: objectInXXXAtIndex: exception
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 9 May 2005 18:00:28 -0700


On May 9, 2005, at 3:45 PM, Bertrand Landry-Hetu wrote:

What happens is that the application starts up, the GUI connects to
the model, everything works. Something triggers an update of our model
and ends up calling removeAllObjects on the NSMutableArray that
represents Bar. So to keep the bindings updated we wrapped that call
in willChangeValueForKey:@"bar", didChangeValueForKey:@"bar", so it
does trigger the NSArrayControllers that is bound to Foo.Bar.

Umm, this is wrong. You're telling observers that something has happened that hasn't...


See:
    <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
    "Batch import into an array, and other mass changes"

You want to do the inverse of adding (so you'll use NSKeyValueChangeRemoval etc.)...

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
References: 
 >objectInXXXAtIndex: exception (From: Bertrand Landry-Hetu <email@hidden>)

  • Prev by Date: Re: Is NSLog secure?
  • Next by Date: Re: AGP cards supported by Core Image
  • Previous by thread: objectInXXXAtIndex: exception
  • Next by thread: Odd Crash with setFrame and plugins' view
  • Index(es):
    • Date
    • Thread