我有这段代码来获取应用程序版本并将其保存到nsdictionary
:
NSString *Version=[NSString stringWithFormat:@"%@",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
NSLog(@"VERSION%@",Version); //prints the right thing
NSMutableDictionary *dic;
[dic setValue:Version forKey:@"version"]; //crash
[dic setValue:Errors forKey:@"errors"]; //work
我在崩溃时遇到的错误是:
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key version
你能帮我找出这个错误吗?
非常感谢 。