我为我的 UiTableView 的每个单元格获取以下 NSDictionary。我必须能够向下钻取并获得下面资产子结构中的第一个 id 值。
{
assets = (
{
"chunk_size" = 262144;
file = {
"is_dirty" = 0;
"mongo_grid_f_s_file" = {
file = {
"_id" = {
"$id" = 503a58e09b41648f69000001;
};
chunkSize = 262144;
filename = "/private/var/tmp/phpPPZsUf";
length = 5849;
md5 = 5f2700f4d953ef866fe1d4967f9965fb;
name = Image1;
uploadDate = {
sec = 1346001120;
usec = 819000;
};
};
gridfs = {
chunks = {
w = 1;
wtimeout = 10000;
};
"chunks_name" = "assets.chunks";
"files_name" = "assets.files";
w = 1;
wtimeout = 10000;
};
};
};
id = 503a58e09b41648f69000001;
length = 5849;
md5 = 5f2700f4d953ef866fe1d4967f9965fb;
name = Image1;
"upload_date" = "0.81900000 1346001120";
},
{
"chunk_size" = 262144;
file = {
"is_dirty" = 0;
"mongo_grid_f_s_file" = {
file = {
"_id" = {
"$id" = 503a58e09b41648f69000004;
};
chunkSize = 262144;
filename = "/private/var/tmp/phphxvI3H";
length = 1551;
md5 = f193ffe87eb0138608a206dcf72bf704;
name = Image2;
uploadDate = {
sec = 1346001120;
usec = 841000;
};
};
gridfs = {
chunks = {
w = 1;
wtimeout = 10000;
};
"chunks_name" = "assets.chunks";
"files_name" = "assets.files";
w = 1;
wtimeout = 10000;
};
};
};
id = 503a58e09b41648f69000004;
length = 1551;
md5 = f193ffe87eb0138608a206dcf72bf704;
name = Image2;
"upload_date" = "0.84100000 1346001120";
}
);
coordinates = {
latitude = "37.78584";
longitude = "-122.4064";
};
"created_at" = "2012-08-26T12:12:00-0500";
id = 503a58e09b4164cf5a00000a;
"number_of_cars" = 1;
}
我尝试了以下方法:
NSDictionary * classifiedAssets = [classified objectForKey:@"assets"];
然后为了获取每个 id,我已经完成了:
[classifiedImages objectForKey:@"id"]
然而,我得到的是:
(503a58e09b41648f69000001, 503a58e09b41648f69000004)
我希望取回各种 ID 的 NSArray,而不是括号逗号分隔的列表。
有小费吗?