iphone - 如何将整数值存储到 iPhone 中的 NSMutableArray

标签 iphone objective-c

我有 NSMutableArray,其值为 10、15、26、28。我想将它们作为整数形式存储到另一个数组中,我该如何存储它们。 谢谢:)

最佳答案

这里是如何添加

[array addObject:[NSNumber numberWithInt:10]];

你可以得到像这样的整数值

//assuming array has nsnumber/nsstring objects.

[[array objectAtIndex:index] intValue];

关于iphone - 如何将整数值存储到 iPhone 中的 NSMutableArray,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6491682/

相关文章:

ios - 如何让 UIAnimation 一次执行一个(迭代 for 循环),而不是一次执行全部?

ios - 最佳代码实践 iPhone & iPad 自定义 View Controller

iphone - 使用 performSelector :withObject: afterDelay: inside UIButton action

ios - iOS 中使用 NSOperation 实现 AsyncTask

objective-c - 您能在这段代码中看到什么错误吗? 'Cause I can’ t,但仍然无法正常工作

ios - 阻止将对象添加到数组......无法让它工作

iphone - 在 iPad 上运行的 iPhone 应用程序中横向 View 顶部有 20 像素间隙

iphone - ASIHTTPRequest 在失去互联网连接后恢复请求

iphone - UITableView 样式设置为 "Grouped",但程序在 iPhone 上使用 "Plain"

iphone - 如何测试 Objective-C 中的原语是否为 nil?