设置枚举对象时,NSUserDefaults会崩溃

时间:2017-02-17 13:49:53

标签: ios

因为我有这样的枚举对象..

self.appState = AppStateLocationEnabledAndConnectedToInternet;
[[NSUserDefaults standardUserDefaults] setObject:@(self.appState) forKey:CURRENT_APP_STATE];

我创建了枚举对象并在NSUserDefaults中设置了它的值

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[6]' 

但它会像这样崩溃

BM_UPLOAD_S3_DESTINATION

我做错了请帮忙

0 个答案:

没有答案