如何檢索價值關鍵在NSDictionary中是價值已經報價角落找尋它從NSDictionary中檢索數據已經在值附近引用了?
代碼:
for(NSDictionary *dict in jsonData)
{
NSString *firstName = [dict valueForKey:@"name_forenames"];
NSString *lastName = [dict valueForKey:@"name_surnames"];
NSLog (@"%@ %@", firstName, lastName);
}
在我的字典
是:
(
{
"name_forenames" = Jordan;
"name_surnames" = Newton;
}, {
"name_forenames" = Jordan;
"name_surnames" = Newton;
}
)
,因爲它只是在我的NSLog中返回null
數據來自服務器還是json在您的項目中定義? –