ios - 如何将 NSData 转换为 NSMultitableArray

标签 ios nsdata

我有一个问题如何将 NSData 转换为 NSMultitableArray

我从 JSON 接收数据,我需要将该数据设置到 TableView 中。 如何做到这一点?

上面是JSON的例子:

{"d":"[{\"codUf\":28,\"descricao\":\"MG\"},{\"codUf\":29,\"descricao\":\"PR\"},{\"codUf\":19,\"descricao\":\"RJ\"},{\"codUf\":25,\"descricao\":\"SP\"}]"}

谢谢!

最佳答案

使用 SBJson https://github.com/stig/json-framework/

否则你可以做

NSError *error = nil;
[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]

关于ios - 如何将 NSData 转换为 NSMultitableArray,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16171887/

相关文章:

ios - 从 UIViewController 呈现 UINavigationController

ios - 无法将 NSData header 与 Swift 中的字符串进行比较

ios - Swift 类型转换 : Getting color data as CGFloat to an NSData of 8bit integers

iphone - 获取 NSData 中的 json

ios - 如果使用 beginBackgroundTaskWithExpirationHandler IOS,应用程序将被杀死

javascript - Google+ JavaScript API 登录弹出窗口不在 iOS 上返回 Chrome

iphone - 使用 NSData block 对文件进行 Base64 编码

ios - 如何找出 NSData 数组的长度?

ios - NSnotification 中心不工作 iOS

ios - NSNotificationCenter是否需要取消UILocalnotficiation?