iOS: NSArray的方法arrayWithObjects:count:

+ (id)arrayWithObjects:(const id[])objects count:(NSUInteger)count


(const id[])objects参数是C类型数组的对象。


NSString *strings[3];


strings[0] = @"First";


strings[1] = @"Second";


strings[2] = @"Third";

NSArray *stringsArray = [NSArray arrayWithObjects:strings count:2];


// strings array contains { @"First", @"Second" }



你可能感兴趣的:(iOS)