已采纳回答 / qq_圖长伴_03445938
NSEnumerator
*en = [array objectEnumerator];33 id
obj; 34 int j
= 0 ; 35 while (obj
= [en nextObject]) { 36 NSLog(@"5遍历array:%d-->%@",j,obj); 37 j++; 38 }
2016-06-07
最新回答 / 无谓艰苦
#import <Foundation/Foundation.h>#import "PeopleAll.h"int main(int argc, const char * argv[]) { @autoreleasepool { PeopleAll *people1 = [[PeopleAll alloc] init]; PeopleAll *people2 = [[PeopleAll alloc] init]; PeopleAll *peopl...
2015-12-03
已采纳回答 / 791956776
对象方法:[[NSDictionary alloc] init];静态方法:[NSDictionary dictionary];字面量:@{};这个静态方法只是对对象方法的一层封装,字面量是用语法糖的简写。NSArray,NSString等都是一样的
2015-10-11
最新回答 / 慕仰0613825
//迭代器 NSEnumerator *enumerator = [array1 objectEnumerator]; id obj = nil; while(obj = [enumerator nextObject]){ NSLog(@"obj=%@",obj); }
2015-07-31