我有一个 NSArray,所以当我这样做时:
NSLog(@"%@", [jokesArray description]);
我得到以下信息:
(
{
"_id" = {
"$id" = 4e91fd49c7e24cda74000000;
};
author = draper;
comments = (
{
author = adias;
comment = "amazing again";
}
);
created = {
sec = 1318118400;
usec = 0;
};
text = "This is a random post again";
title = "post # 2";
type = (
punjabi
);
},
{
"_id" = {
"$id" = 4e8cf1d6c7e24c063e000000;
};
author = faisal;
comments = (
{
author = adias;
comment = amazing;
},
{
author = nike;
comment = "I concur";
}
);
created = {
sec = 1317772800;
usec = 0;
};
text = "This is a random post";
title = "post # 1";
type = (
punjabi
);
}
)
我如何访问特定元素中的文本键?
我尝试时遇到错误:
[[cell textLabel]setText:[[jokesArray objectAtIndex:[indexPath row]]valueForKey:@"text"]];
最佳答案
EXC_BAD_ACCESS 表示您提供了错误的指针。也许您未能正确保留 jokesArray?
关于iphone - 在以下示例中如何从 NSSArray 元素获取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7707514/