简体   繁体   English

<extracting data from value failed>在NSDictionary中

[英]<extracting data from value failed> in NSDictionary

I am stuck at a point when I convert data from web services to NSDictionary. 当我将数据从Web服务转换为NSDictionary时,我陷入困境。 But while accessing on console in debug mode it returns , while when i bind the values of dictionary with view it works perfectly. 但是当在调试模式下访问控制台时,它会返回,而当我将字典的值与视图绑定时,它可以完美地工作。 Below is the code:- 以下是代码: -

NSDictionary *responseDict =  [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&e];

and at console i am using po [dictName valueForKey:@"Status"] as well as po [dictName objectForKey:@"Status"] . 在控制台我使用po [dictName valueForKey:@"Status"]以及po [dictName objectForKey:@"Status"] Followed few steps but does not work for me 1. setting Optimization level to none already in this mode. 遵循几个步骤,但对我不起作用1.在此模式下将优化级别设置为none。 2.Edit scheme to debug mode already in this mode. 2.在此模式下已编程调试模式。

I meet this problem when I try to get information from Info.plist . 当我尝试从Info.plist获取信息时,我遇到了这个问题。 Finally I use a string exchange. 最后我使用字符串交换。

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];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM