NSArray categories documentation
ETKeyValuePairRepresentation
NSArray (ETKeyValuePairRepresentation)Default
- - (NSDictionary *) dictionaryRepresentation
Returns a dictionary where every ETKeyValuePair present in the array is turned into a key/value entry.
For every other object, its index in the array becomes its key in the dictionary.
The returned dictionary is autoreleased.
Raises an NSGenericException when the receiver contains an object which is not an ETKeyValuePair object.
ETCollection
NSArray (ETCollection) <ETCollection>ETCollectionHOM
NSArray (ETCollectionHOM) <ETCollectionHOM>Etoile
NSArray (Etoile)Default
- - (id) firstObject
Returns the first object in the array, otherwise returns nil if the array is empty.
- - (NSArray *) arrayByRemovingObject: (id)anObject
Returns a new array by copying the receiver and removing the objects equal to the given one.
- - (NSArray *) arrayByRemovingObjectsInArray: (NSArray *)anArray
Returns a new array by copying the receiver and removing the objects equal to those contained in the given array.
- - (NSArray *) filteredArrayUsingPredicate: (NSPredicate *)aPredicate ignoringObjects: (NSSet *)ignoredObjects
Returns a filtered array as -filteredArrayWithPredicate: does but always includes in the new array the given objects to be ignored by the filtering.
Deprecated
- - (NSArray *) objectsMatchingValue: (id)value forKey: (NSString *)key
Deprecated
Returns the objects on which -valueForKey: returns a value that matches the given one.
For every object in the receiver, -valueForKey: will be invoked with the given key.
NSArray *personsNamedJohn = [persons objectsMatchingValue: @"John" forKey: @"name"];
You should now use -filteredArrayUsingPredicate or -filter instead. For example:
NSArray *personsNamedJohn = [persons filteredArrayUsingPredicate: [NSPredicate predicateWithFormat: @"name == %@", @"John"]];
Deprecated
Returns the objects on which -valueForKey: returns a value that matches the given one.
For every object in the receiver, -valueForKey: will be invoked with the given key.
NSArray *personsNamedJohn = [persons objectsMatchingValue: @"John" forKey: @"name"];
You should now use -filteredArrayUsingPredicate or -filter instead. For example:
NSArray *personsNamedJohn = [persons filteredArrayUsingPredicate: [NSPredicate predicateWithFormat: @"name == %@", @"John"]];