title: NSArray writeToFile returning "is deprecated" - iPhone SDK
body: <p>I'm trying to save some settings from my app to a plist file when it closes, then load them when the app launches. I have 4 numbers saved in an NSArray called array. The loading works fine because if I change the file, the app starts the way the file was changed.</p>
  
  <p>This code works fine:</p>
  
  <pre><code>- (void)LoadSettings {
  NSString *path = [[NSBundle mainBundle] bundlePath];
  NSString *finalPath = [path stringByAppendingPathComponent:kSaveFileLocation];
  NSArray *array = [[NSArray alloc] initWithContentsOfFile:finalPath];
  clockFaceImageSlider.value = [[array objectAtIndex:0] integerValue];
  HourTypeSwitch.on = [[array objectAtIndex:1] integerValue];
  touchRotationSwitch.on = [[array objectAtIndex:2] integerValue];
  accelerometerRotationSwitch.on = [[array objectAtIndex:3] integerValue];
  }
  </code></pre>
  
  <p>This code works up to the save line:</p>
  
  <pre><code>- (void)SaveSettings {
      NSString *path = [[NSBundle mainBundle] bundlePath];
      NSString *finalPath = [path stringByAppendingPathComponent:kSaveFileLocation];
      NSArray *array = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:clockFaceImageSlider.value], [NSNumber numberWithInt:HourTypeSwitch.on], [NSNumber numberWithInt:touchRotationSwitch.on], [NSNumber numberWithInt:accelerometerRotationSwitch.on], nil];
  
      if (![array writeToFile:finalPath atomically:YES]) {
          NSLog(@"error");
      }
      //The log does print error
  }
  </code></pre>
  
  <p>Does anybody know how I can make it save to the plist?</p>
  
  <p>~thanks</p>