title: app crashes when accessing plist on ipad, but not in simulator
body: <p>In my app im using 3 different plists. 2 of them work fine, but when i try to access the third, it crashes on the ipad. Works fine in the simulator.</p>
  
  <p>here is the code i use to access my plists</p>
  
  <pre><code>NSError *error;
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  
  NSString *documentsDirectory = [paths objectAtIndex:0];
  self.path = [documentsDirectory stringByAppendingPathComponent:@"profiles.plist"];
  self.path2 = [documentsDirectory stringByAppendingPathComponent:@"services.plist"];
  
  NSFileManager *fileManager = [NSFileManager defaultManager];
  
  if (![fileManager fileExistsAtPath:path])
  {
      NSString *bundle = [[NSBundle mainBundle] pathForResource:@"profiles" ofType:@"plist"];
      [fileManager copyItemAtPath:bundle toPath:path error:&amp;error];
  }
  
  if (![fileManager fileExistsAtPath:path2])
  {
      NSString *bundle = [[NSBundle mainBundle] pathForResource:@"services" ofType:@"plist"];
      [fileManager copyItemAtPath:bundle toPath:path2 error:&amp;error];
  }
  </code></pre>
  
  <p>When i go to write to it </p>
  
  <pre><code>NSString *pName = profileName;
  [self dismissModalViewControllerAnimated:YES];
  
  NSMutableArray *profilesArr = [[[NSMutableArray alloc] initWithContentsOfFile:path]autorelease];
  NSMutableDictionary *tempDict = [[[NSMutableDictionary alloc] init ]autorelease] ;
  
  NSMutableArray *tempArr = [[[NSMutableArray alloc] init]autorelease];
  
  for (int i = 0; i &lt; [self.visibleLegend count]; i++)
  {
      NSMutableDictionary *legendDict = [[[NSMutableDictionary alloc] init]autorelease];
      AGSLayerDefinition *layer = [self.visibleLegend objectAtIndex:i];
      NSString *layerDef = layer.definition;
      NSString *layerId = [NSString stringWithFormat:@"%d", layer.layerId];
      NSLog(@"save ID %@, save DEF %@", layerId, layerDef);
  
      [legendDict setObject:layerId forKey:@"layerID"];
      [legendDict setObject:layerDef forKey:@"layerDEF"];
  
      [tempArr addObject:legendDict];
  }
  
  NSString *dynamicURL = [self findServiceName:[self.dynamicLayer.URL absoluteString]];
  NSString *tiledURL = [self findServiceName:[self.tiledLayer.URL absoluteString]];
  
  [tempDict setObject:pName forKey:@"profileName"];
  [tempDict setObject:dynamicURL forKey:@"dynamicLayer"];
  [tempDict setObject:tiledURL forKey:@"backgroundLayer"];
  [tempDict setObject:tempArr forKey:@"visibleLegend"];
  
  [profilesArr addObject:tempDict];
  if ([profilesArr containsObject:tempDict])
      NSLog(@"added");
  if ([profilesArr writeToFile:path atomically:NO])
      NSLog(@"new saved");
  </code></pre>
  
  <p>the plist stored in path is the only one that seems to crash on the iPad. i cant figure out whats wrong. the debug just shows a bad access to an assembly language line of code.</p>