//OC自帶方法enumerateObjectsUsingBlock //默認正序遍歷 [array enumerateObjectsUsingBlock:^(id obj, NSUinter idx, BOOL *stop)];{ NSLog(@"%@,%@",idx,obj); } //倒序遍歷 [array enumerateObjectWithOptions:NSEnumerationReverse usingBlock: ^(id obj, NSUinter idx, BOOL *stop)];{ NSLog(@"%@,%@",idx,obj); } //利用枚舉 NSEnumerator *en = [array objectEnumerator]; id obj; int j = 0; while (obje = [en nextObject]){ NSLog(@"%d,%@",j,obj); j++; }