I have a UILabel that is modified while using my a开发者_StackOverflow中文版pp. I want the text of this UILabel to be saved even after I close the app.
What's the easiest way for doing this?
Save the content when the app is about to quit.
- (void)applicationWillTerminate:(UIApplication *)application
{
    [[NSUserDefaults standardUserDefaults] setObject:label.text forKey:@"label"];
}
And when you create the label, use the saved text.
label.text = [[NSUserDefaults standardUserDefaults] objectForKey:@"label"];
NSUserDefaults will help you with this !
Watch this tutorial on how to use NSUserDefaults for storing/ saving data - Save Data In Your iPhone App Using NSUserDefaults Tutorial
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论