我有這個代碼來獲取應用程序版本,並將其保存到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
你能幫助我找出這個錯誤?
非常感謝。