• 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: NSArrayController's "selectionIndex" weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController's "selectionIndex" weirdness


  • Subject: Re: NSArrayController's "selectionIndex" weirdness
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 11 Apr 2008 11:37:36 -0700


On Apr 11, 2008, at 11:19, Johnny Lundy wrote:

Now I am running into the "View Doesn't Update When Model Is Changed" issue that Apple lists under "Troubleshooting Cocoa Bindings", in that the array element gets removed by my "removeObjectAtIndex: [theIndex integerValue]", but that is apparently not KVO-compliant.

...

Can someone point me to an example of using removeObjectAtIndex: and having KVO take care of updating the NSTableView? Thanks. I have already declared the model array as mutable, @property (readwrite, copy) and @synthesize.

If 'someObject' is an instance of the class that has playerArray as a property, the KVO-compliant way is:


[[someObject mutableArrayValueForKey:@"playerArray"] removeObjectAtIndex:theWhackedOne];


_______________________________________________

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


References: 
 >Re:NSArrayController's "selectionIndex" weirdness (From: Johnny Lundy <email@hidden>)

  • Prev by Date: Core Data and the Document Dirty indicator
  • Next by Date: Restoring Tiger NSTableView behaviour in Leopard
  • Previous by thread: Re:NSArrayController's "selectionIndex" weirdness
  • Next by thread: Core Data, Threads and Document based app
  • Index(es):
    • Date
    • Thread