【发布时间】:2023-03-24 06:53:01
【问题描述】:
是否可以更新存储在 NSUserDefaults 中的名为 customerName 的数组?
这是我目前的代码:
accounts = [NSUserDefaults standardUserDefaults];
NSArray *customerName = [[NSArray alloc] initWithObjects:@"J BLOGGS", @"J BLOGGS", nil];
[accounts setObject:customerName forKey:@"customerName"];
[accounts synchronize];
NSLog(@"%@", [[accounts objectForKey:@"customerName"] objectAtIndex:0]);
【问题讨论】:
标签: ios objective-c nsarray nsuserdefaults