title: App works fine on 4S, but crashes on 3G, because of SIGABRT
body: <p>When the user starts the app for the first time he gets a pop up and has to save an image. It works on the simulator and on the 4S. But when I start it with my 3G it gives me a SIGABRT error as soon as I chose a picture. I assume its because of the size of the picture which is too pick and therefore claiming all of the ram - But that is rather weird, because I make it much smaller. Here is the code: </p>
  
  <pre><code>- (void)viewDidLoad
  { 
      [super viewDidLoad];
      if ([[NSUserDefaults standardUserDefaults] objectForKey:@"bild"] == nil) { 
          picker = [[UIImagePickerController alloc] init];
          picker.delegate = self;
          picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
          [self presentModalViewController:picker animated:YES];
      }
  }
  
  - (void)imagePickerController:(UIImagePickerController *) Picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
      double compressionRatio=1;
      NSData *imageData=UIImageJPEGRepresentation([info objectForKey:@"bild"],compressionRatio);
      while ([imageData length]&gt;5000) { 
          compressionRatio=compressionRatio*0.20;
          imageData=UIImageJPEGRepresentation([info objectForKey:@"bild"],compressionRatio);
      }
  
      UIImage *yourUIImage;
      yourUIImage = [info objectForKey:UIImagePickerControllerOriginalImage];
      imageData = [NSKeyedArchiver archivedDataWithRootObject:yourUIImage];
      [[NSUserDefaults standardUserDefaults] setObject:imageData forKey:@"bild"];
      [[NSUserDefaults standardUserDefaults] synchronize];
  
      [self dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>I get the SIGABRT error at this line     imageData = [NSKeyedArchiver archivedDataWithRootObject:yourUIImage];</p>
  
  <p>Should I use another method to resize the image? Or should I save it as a local file and retrieve it everytime the app starts? (If its possible)</p>