[NSKeyValueArray removeObjectAtIndex:]: selector not recognized
[NSKeyValueArray removeObjectAtIndex:]: selector not recognized
- Subject: [NSKeyValueArray removeObjectAtIndex:]: selector not recognized
- From: Christian Schneider <email@hidden>
- Date: Wed, 16 Mar 2005 11:17:25 +0100
Hi all,
I have a class ClipLibrary with the following KVC compliant methods:
- (unsigned int)countOfClipLibrary
- (id)objectInClipLibraryAtIndex:(unsigned int)index
- (void)insertObject:(id)anObject inClipLibraryAtIndex:(unsigned int)index
- (void)removeObjectFromClipLibraryAtIndex:(unsigned int)index
- (void)replaceObjectInClipLibraryAtIndex:(unsigned int)index
withObject:(id)anObject
I have a custom ArrayController class that binds itself to the above
(in awakeFromNib) with:
[self bind:@"content" toObject:clipLibrary withKeyPath:@"clipLibrary"
options:nil];
[clipLibrary addObserver:self forKeyPath:@"clipLibrary"
options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
context:NULL];
I have a table view (copied from mmalcom's
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html) that
calls after delete is pressed
[tableContentController removeObjectsAtArrangedObjectIndexes:[self
selectedRowIndexes]];
where the tableContentController is bound to my ArrayController with
the following calls (in the awakeFromNib of a different controller)
[libraryTable bind:@"content" toObject:clipLibraryController
withKeyPath:@"arrangedObjects" options:nil];
[libraryTable bind:@"selectionIndexes" toObject:clipLibraryController
withKeyPath:@"selectionIndexes" options:nil];
[libraryTable bind:@"sortDescriptors" toObject:clipLibraryController
withKeyPath:@"sortDescriptors" options:nil];
When I try to delete a record from the table view, I get the following error:
*** -[NSKeyValueArray removeObjectAtIndex:]: selector not recognized
A google search on NSKeyValueArray returns zilch.
I want my ArrayController to observe its ClipLibrary to have a
-observeValueForKeyPath:ofObject:change:context: with easy access to
the deleted elements (I have to reflect the deletions in a database).
What am I doing wrong (I got this working in another part of my app
just fine but I can't figure out what's different).
chris
_______________________________________________
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