Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>The std way would be to check if there is a value in NSUserDefaults and if that value doesn't exist (such as on first run) then create the value so on the rest of the starts you will know its not first run.</p></li> <li><p>This is also a good candidate to use the NSUserDefaults and set key/value pares for each setting/permission you want.</p></li> </ol> <p><a href="http://icodeblog.com/2008/10/03/iphone-programming-tutorial-savingretrieving-data-using-nsuserdefaults/" rel="nofollow noreferrer">Here's a quick tutorial on using NSUserDefaults.</a></p> <p>Summary from that site for Saving:</p> <pre><code>NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; // saving an NSString [prefs setObject:@"TextToSave" forKey:@"keyToLookupString"]; // saving an NSInteger [prefs setInteger:42 forKey:@"integerKey"]; // saving a Double [prefs setDouble:3.1415 forKey:@"doubleKey"]; // saving a Float [prefs setFloat:1.2345678 forKey:@"floatKey"]; // This is suggested to synch prefs, but is not needed (I didn't put it in my tut) [prefs synchronize]; </code></pre> <p>Loading:</p> <pre><code>NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; // getting an NSString NSString *myString = [prefs stringForKey:@"keyToLookupString"]; // getting an NSInteger NSInteger myInt = [prefs integerForKey:@"integerKey"]; // getting an Float float myFloat = [prefs floatForKey:@"floatKey"]; </code></pre> <p>NSUserDefaults is perfect for saving app settings, and purchase history but if you are wanting to store much data then you should use another way. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload