Re: NSArrayController's "selectionIndex" weirdness
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