标签:oc 遍历
#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { NSArray * array = [[NSArray alloc]initWithObjects:@"one one",@"Two",@"Three", nil]; //快速枚举法 for (NSString * temp in array) { NSLog(@"%@",temp); } //枚举器法 NSEnumerator * myenum = [array objectEnumerator]; id obj; while (obj = [myenum nextObject]) { NSLog(@"%@",obj); } //下标法 for (int i=0; i<[array count]; i++) { NSLog(@"%@",[array objectAtIndex:i]); } } return 0; }
本文出自 “网络学习总结” 博客,请务必保留此出处http://8947509.blog.51cto.com/8937509/1574449
标签:oc 遍历
原文地址:http://8947509.blog.51cto.com/8937509/1574449