Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将元素添加到数组的末尾?我知道有一个方法 objectAtIndex: 但是如何检查我是否位于数组的末尾?
而不是objectAtIndex,你可以addObject:
objectAtIndex
addObject:
根据开发人员说明:
在数组末尾插入给定对象。
- (void)addObject:(id)anObject
来自苹果文档:[array addObject:obj];
[array addObject:obj];
你是什么意思:
如何检查我是否位于数组的末尾?
默认情况下,对象放在最后。
https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/Reference/Reference.html