Skip to content

Instantly share code, notes, and snippets.

Method Description
+(id) stringWithCapacity:size Creates a string initially containing size characters.
-(id) initWithCapacity:size Initializeds a string with an initial capacity of size characters
-(void) setString:nsstring Sets a string to nsstring.
-(void) appendString:nsstring Appends nsstring to the end of the receiver.
-(void) deleteCharactersInRange:range Dletes characters in a specified range.
Method Description
+(id) arrayWithObjects:obj1, obj2,... nil Creates a new array with obj1, obj2, ... as its elements.
-(BOOL) containsObject:obj Determines whether the array contains obj(uses the isEuqal: method).
-(NSUInteger) count Indicates the number of elements in the array
-(NSUInteger) indexOfObject:obj Specifies the index number of the first element that
contains obj(uses the isEqual: method).
Method Description
+(id) array Creates an empty array
+(id) arrayWithCapacity:size Creates an array with a specified initial size
+(id) initWithCapacity:size Initializes a newly allocated array with a specified initial size
-(void) addObject:obj Adds obj to the end of the array
-(void) insertObject:obj atIndex:i Inserts obj into element i of the array
Typedef data type Description Wrapper Method Unwrapper Method
CGPoint A point consisting of valueWithPoint: pointValue
an x and y value
CGSize A size consisting of valueWithSize: sizeValue
a width and height
CGRect A rectangle consisting valueWithRect: rectValue
of an origin and size
Method Description
+(id)dictionaryWithObjectsAndKeys:obj1, Creates a dictionary with key-object pairs
key1, obj2, key2, ..., nil {key1, obj1}, {key2, obj2}, ...
-(id) initWithObjectsAndKeys:obj1, key1, Initializes a newly allocated dictionary
obj2, key2, ..., nil with key-object pairs {key1, obj1}, {key2, obj2}, ...
-(NSArray *) allKeys Returns an array containing all the keys
from the dictionary
Method Description
+(id) dictionaryWithCapacity:size Creates a mutable dictionary with an initial specified size
-(id) initWithCapacity:size Initializes a newly allocated dictionary to be of an initial
specified size
-(void) removeAllObjects Removes all entries from the dictionary
-(void) removeObjectForKey:key Removes the entry for the specified key from the dictionary
Method Description
+(id) setWithObjects:obj1, obj2, ..., nil Creates a new set from the list of objects
-(id) anyObject Returns any object from the set
-(id) initWithObjects:obj1, obj2, ..., nil Initializes a newly allocated set with a list oft objects.
-(BOOL) containsObject:obj Determines whether the set contains obj
-(BOOL) member:obj Determines whether the set contians obj
Method Description
+(id) setWithCapacity:size Creates a new set with an initial capacity to store
-(id) initWithCapacity:size Sets the initial capacity of a newly allocated
set to size members
-(void) addObject:obj Adds obj to the set
-(void) removeObject:obj Removes obj from the set
Method Description
+(NSIndexSet) indexSet Creates an empty index set
-(BOOL) containIndex:idx Returns YES if the index set contains the
index idx, NO otherwise.
-(NSUinteger) count Returns the numbers of indexes in the indexed set.
-(NSUinteger) indexLessThanIndex:idx Returns the closest index in the set less than idx
or NSNotFund if none is less than idx(see also:
Method Description
-(NSData *) contentsAtPath:path Reads data from a file
-(BOOL) createFileAtPath:path contents: Writes data to a file
(NSData *)data attributes:attr
-(BOOL) removeItemAtPath:path error:err Removes a file
-(BOOL) moveItemAtPath:from toPath:to Renames or moves a file
error:err (to cannot already exist)