+ (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" }
本文介绍了 NSArray 类中 arrayWithObjects 方法的使用方式,演示了如何通过该方法创建包含特定对象的数组,并提供了一个示例,展示了如何仅添加指定数量的对象到数组中。
3101

被折叠的 条评论
为什么被折叠?



