我有一个包含键/值对的NSMutableDictionary,当我尝试调试内容时,它似乎正确加载了:
NSLog(@"%@",[item objectForKey:@"title"]);//result: iOS in 24 hours.
但是当我尝试将此值分配给另一个NSString时,我得到一个空值
NSString *title = [item objectForKey:@"title"];// even tried to cast it using (NSString*)
NSLog(@"%@",title);//null value
答案 0 :(得分:0)
如下所示: -
if (item[@"title"] == [NSNull null])
{
//your code
}