我有回來一些這樣的JSON:如何處理布爾值與AFNetworking解析JSON
"items":[
{
"has_instore_image": false
}
]
如果我輸出這樣的值:
NSLog(@"has_instore_image val: %@", [item objectForKey:@"has_instore_image"]);
我得到
has_instore_image val: 0
但如果我測試像這樣:
if([item objectForKey:@"has_instore_image"]==0){
NSLog(@"no, there is not an instore image");
}else{
...
它總是去else語句...嗯..你會如何建議我得到布爾值和測試?我在這裏讀過BOOL的問題,只是感到困惑,這不像我預期的那樣工作。
THX