NSObject
在iOS SDK里是所有对象的基类
实现了所有的內省introspection
方法
主要的方法
-
- (NSString *)description
是一个很重要的方法,它重写了NSLog()
里的%@
例如:NSLog(@“array contents are %@”, myArray);
如果重写了
description
,%@
实际执行的是[myArray description]
方法 -
- (id)copy;
-
- (id)mutableCopy;
NSArray
主要的方法
- (NSUInteger)count;
- (id)objectAtIndex:(NSUInteger)index;
- (id)lastObject;
- (id)firstObject;
用的比较少的方法
-
- (NSArray *)sortedArrayUsingSelector:(SEL)aSelector;
-
- (void)makeObjectsPerformSelector:(SEL)aSelector withObject:(id)selectorArgument;
-
- (NSString *)componentsJoinedByString:(NSString *)separator;