NSObject (EDExtensions)


Declared In:
NSObject+Extensions.h


Category Description

Various common extensions to NSObject.


Method Types

Developer notes
- methodIsAbstract:
- methodIsObsolete:
- methodIsObsolete:hint:
Class hierarchy
+ subclasses
Mapping an array
- mapArray:withSelector:
Repeatedly performing a selector
- performSelector:withObjects:
- performSelector:withObjectsEnumeratedBy:


Class Methods

subclasses

+ (NSArray *)subclasses

Returns all subclasses of the receiving class


Instance Methods

mapArray:withSelector:

- (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.


methodIsAbstract:

- (volatile void)methodIsAbstract:(SEL)selector

Raises an NSInternalInconsistencyException stating that the method must be overriden.


methodIsObsolete:

- (void)methodIsObsolete:(SEL)selector

Prints a warning that the method is obsolete. This warning is only printed once per method.


methodIsObsolete:hint:

- (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.


performSelector:withObjects:

- (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.


performSelector:withObjectsEnumeratedBy:

- (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.


Version 2.2 Copyright ©2003. All Rights Reserved.