[示例]NSEnumerator-使用枚举类型实现数组的逆序输出
代码:
#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSMutableArray *array = [NSMutableArray arrayWithObjects:@"3",@"2",@"5",nil]; NSArray* reversedArray = [[array reverseObjectEnumerator] allObjects]; for (id str in reversedArray) { NSLog(@"%@",str); } } return 0; }