Skip navigation.
 
mlList of Indexed Accessor Names for NSMutableArray
FROM : Markus Spoettl
DATE : Sat Jun 28 21:56:29 2008

Hello List,

  is there a complete list of indexed accessor names that can be 
implemented? The KVC guides just mentions the basic ones

- (NSUInteger)countOf<key>
- (id)objectIn<key>AtIndex:(unsigned)theIndex
- (void)get<key>:(id *)objsPtr range:(NSRange)range
- (void)insertObject:(id)obj in<key>AtIndex:(NSUInteger)theIndex
- (void)removeObjectFrom<key>AtIndex:(NSUInteger)theIndex
- (void)replaceObjectIn<key>AtIndex:(NSUInteger)theIndex withObject:
(id)obj

I had this in my code

- (void)remove<key>AtIndexes:(NSIndexSet *)indexes
{
    NSMutableArray *kva = [self mutableArrayValueForKey:@"<key>"];
    [kva removeObjectsAtIndexes:indexes];
}

which caused an endless recursion because [kva 
removeObjectsAtIndexes:] assumes that remove<Key>AtIndexes: is the KVC 
implementation for it. Of course it was not. I can't find any mention 
in the documentation about this accessor name.

So, is there complete list of method names or is it just all 
NSMutableArray methods that contain "Objects" in their name with 
"Objects" replaced by "<key>" ?

Regards
Markus
--

Related mailsAuthorDate
mlList of Indexed Accessor Names for NSMutableArray Markus Spoettl Jun 28, 21:56
mlRe: List of Indexed Accessor Names for NSMutableArray Kyle Sluder Jun 28, 22:03
mlRe: List of Indexed Accessor Names for NSMutableArray Markus Spoettl Jun 29, 00:53
mlRe: List of Indexed Accessor Names for NSMutableArray Keary Suska Jun 29, 01:02
mlRe: List of Indexed Accessor Names for NSMutableArray Clark Cox Jun 29, 01:06
mlRe: List of Indexed Accessor Names for NSMutableArray Markus Spoettl Jun 29, 01:38
mlRe: List of Indexed Accessor Names for NSMutableArray Quincey Morris Jun 29, 02:07
mlRe: List of Indexed Accessor Names for NSMutableArray Markus Spoettl Jun 29, 02:36