我正在尝试将NSMutableArray
存储到NSUserDefaults
中,如下所示,但会收到以下错误。
(lldb) po pOrderElements
<__NSArrayM 0x174256b90>(
{
category = 1;
imagePath = "products/chicken-kabob.png";
name = "Baked Chicken";
price = "5.49";
}
)
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:pOrderElements forKey:@"tableViewData"];
[userDefaults synchronize];
由于未捕获的异常而终止应用 'NSInvalidArgumentException',原因:'尝试插入非属性 列表对象( { category = 1; id =“”; imagePath =“products / chicken-kabob.png”; name =“烤鸡”; price =“5.49”; })for key tableViewData'