Nsuserdefauls problem
<p>I have typed the coding under the highscore button. It is suppose to string the text(name) in the textbox and save the highscore. However, i could not find any plist being created under the document. Please help</p>

<pre><code>-(IBAction)savehighscore_button {


 int i, ii = -1;

 struct high_score {
  NSString *name;
  int highScore;
 };

 struct high_score structArray[10];

 NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];

 for (i=0; i&lt;10; i++) {

  if ([userPreferences stringForKey :[NSString stringWithFormat:@"highScoreNameEntry%d",i]]!=nil &amp;&amp; [userPreferences stringForKey :[NSString stringWithFormat:@"highScoreEntry%d"]]!=nil) {
  structArray[i].name= [userPreferences stringForKey:[NSString stringWithFormat:@"highScoreNameEntry%d",i]];
   structArray[i].highScore = [userPreferences integerForKey:[NSString stringWithFormat:@"highScoreEntry%d",i]];
   ii = i;
  }
 }
 if (myScore &gt;0) {
  for (i==ii; i&gt;=0; i--) {
   if (myScore &gt; structArray[i].highScore) {
    if (i&lt;9) {
     structArray[i+1] = structArray[i];
     structArray[i].name = nametextbox.text;
     structArray[i].highScore = myScore;

     if (i==ii &amp;&amp; i&lt;9) {
      structArray[i+1].name = nametextbox.text;
      structArray[i+1].highScore = myScore;
      ii=i+i;
     }

     else if(i==ii &amp;&amp; i&lt;9) {
      structArray[i+1].name = nametextbox.text;
      structArray[i+1].highScore = myScore;
      ii=i+1;
     }
    }
   }

   if (ii==-1 &amp;&amp; myScore &gt;0) {
    structArray[0].name = nametextbox.text;
    structArray[0].highScore = myScore;
    ii=0;
   }
   for (i=0; i&lt;=ii; i++) {
    [userPreferences setObject:structArray[i].name forKey:[NSString stringWithFormat:@"highScoreNameEntry%d",i]];
    [userPreferences setInteger:structArray[i].highScore forKey:[NSString stringWithFormat:@"highScoreEntry%d",i]];
   }
  }
 }

}
</code></pre>
