[Solved] All NSUserDefaults, all in tableview
You can set an array to userDefaults, the implementation is very simple. – (void)viewDidLoad { [super viewDidLoad]; [self addTextToUserDefaults:@”hello”]; [self addTextToUserDefaults:@”how are you?”]; [self addTextToUserDefaults:@”hi”]; for (NSString *text in [self textsInUserDefaults]) { NSLog(@”%@”, text); } } – (void)addTextToUserDefaults:(NSString *)aText { NSMutableArray *texts = [[[NSUserDefaults standardUserDefaults] objectForKey:@”textArray”] mutableCopy]; if (!texts) { texts = [NSMutableArray new]; } … Read more