- Declared In:
- NSObject+Extensions.h
Developer notesClass hierarchy
- - methodIsAbstract:
- - methodIsObsolete:
- - methodIsObsolete:hint:
Mapping an array
- + subclasses
Repeatedly performing a selector
- - mapArray:withSelector:
- - performSelector:withObjects:
- - performSelector:withObjectsEnumeratedBy:
+ (NSArray *)subclasses
Returns all subclasses of the receiving class
- (NSArray *)mapArray:(NSArray *)anArray withSelector:(SEL)aSelector
Invokes the method described by selector in the receiver once for each object in anArray and collects the return values in another array that is returned. Note that the selector is assumed to take one argument, the current object from the array, and return the corresponding object.
Example: Assume you have an array a which contains names and an object phoneBook implementing a method lookupPhoneNumber: which returns a phone number for a name. In this case you can use [phoneBook mapArray:a withSelector:@selector(lookupPhoneNumber:)] to get the corresponding array of phone numbers.
- (volatile void)methodIsAbstract:(SEL)selector
Raises an NSInternalInconsistencyException stating that the method must be overriden.
- (void)methodIsObsolete:(SEL)selector
Prints a warning that the method is obsolete. This warning is only printed once per method.
- (void)methodIsObsolete:(SEL)selector hint:(NSString *)hint
Prints a warning that the method is obsolete including the hint supplied. This warning is only printed once per method.
- (void)performSelector:(SEL)selector withObjects:(NSArray *)objectList
Invokes the method described by selector in the receiver once for each object in array, passing the respective object as an argument.
- (void)performSelector:(SEL)selector withObjectsEnumeratedBy:(NSEnumerator *)enumerator
Invokes the method described by selector in the receiver once for each object enumerated by enumerator, passing the respective object as an argument.