<NSDictionary中的<从值失败中提取数据>

Anu*_*pta 9 iphone nsdictionary ios nsjsonserialization xcode8

当我将数据从Web服务转换为NSDictionary时,我陷入困境.但是当在调试模式下访问控制台时,它会返回,而当我将字典的值与视图绑定时,它可以完美地工作.以下是代码: -

NSDictionary *responseDict =  [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&e];
Run Code Online (Sandbox Code Playgroud)

在控制台我使用po [dictName valueForKey:@"Status"]以及po [dictName objectForKey:@"Status"].遵循几个步骤,但对我不起作用1.在此模式下将优化级别设置为none.2.在此模式下已编程调试模式.

小智 1

当我尝试从 获取信息时遇到这个问题Info.plist。最后我使用字符串交换。

NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Info"ofType:@"plist"];
    NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
    NSString *version = [data objectForKey:@"CFBundleShortVersionString"];
    self.labVersion.text = [NSString stringWithFormat:@"(%@)", version];
Run Code Online (Sandbox Code Playgroud)