iphone - 在 NSMutableArray 的开头添加一个对象?

标签 iphone objective-c ios nsmutablearray deque

有没有一种有效的方法可以将对象添加到 NSMutableArray 的开头?我在 objective C 中寻找一个好的双端队列也可以。

最佳答案

简单

[array insertObject:obj atIndex:0];

查看documentation

关于iphone - 在 NSMutableArray 的开头添加一个对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7292568/

相关文章:

ios - 从 AppDelegate 发送 NSNotification

ios - UIImageView 中突出显示的图像到底是什么?

iphone - 是否可以将 NSString 加粗?

ios - 在 Game Center Enabled App 中处理 iOS Game Center App 中的选定回合/游戏

iphone - 将 GLInt 作为引用传递时遇到问题

ios - ios 标签栏触摸和触摸手势的奇怪错误

ios - UILabel 中的可点击用户名和主题标签(不是 UIWebView!)

ios - 如何获取 iOS 设备硬件规范?

ios - @IBInspectable NSLayoutConstraint 不工作 Xcode 8.2.1 (8C1002)

Objective-C 实例变量/属性的多重声明