你如何保存数据使用iOS版上NSUserDefaults的两个文本字段?
Answer 1:
为了节省:
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:FirstTextView];
[[NSUserDefaults standardUserDefaults] setObject:[NSDate date] forKey:SecondTextView];
[[NSUserDefaults standardUserDefaults] synchronize];
对于负载:
NSDate *textfield1Date = [[NSUserDefaults standardUserDefaults] objectForKey:FirstTextView];
NSDate *textfield2Date = [[NSUserDefaults standardUserDefaults] objectForKey:SecondTextView];
文章来源: How do you save data for two text fields using NSUserDefaults?