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.
NSMutableArray * arr = [[NSMutableArray alloc]initWithObjects:@"1",@"2",...@"n" ,nil];
如何获得这个数组的最后一个位置
任何帮助都非常感谢
提前致谢
你得到数组的最后一个对象,如下所示:
[arr lastObject]
数组中的项目数:
[arr count]
获取最后一个对象:
[arr lastObject];
并获得最后一个对象的位置:
[arr count] - 1;
最后一个元素的索引:
int index = [arr count] - 1;
最后一个元素: