Inter-ViewController parameters passing in iPhone programming… how to?

后端 未结 1 1792
心在旅途
心在旅途 2020-12-20 07:17

I read: iPhone: How to Pass Data Between Several Viewcontrollers in a Tabbar App and was wondering what is the difference between

[[UIApplication sharedAppl         


        
相关标签:
1条回答
  • 2020-12-20 07:20

    You can store name and score in NSUserDefaults.

    Retrieve an item:

    NSString *name = [[NSUserDefaults standardUserDefaults]objectForKey:@"name"];
    

    Setting an item:

    [[NSUserDefaults standardUserDefaults]setObject:@"Horace" forKey:@"name"];
    

    Also, if this is data that you want to preserve across launches of the app, you may want to archive it into a plist.

    0 讨论(0)
提交回复
热议问题