title: how to solve this error of Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type 1 not available'
body: <p>I have working on pick the photo from gallery and save in gallery </p>
  
  <p>my code is </p>
  
  <pre><code>-(void)onclicksave:(id)sender
  {
      NSLog(@"onclicksave");
      UIImagePickerController *picker=[[UIImagePickerController alloc]init];
      picker.delegate=self;
  
      if((UIButton *)sender== openLibrary)
      {
          picker.sourceType=UIImagePickerControllerSourceTypeSavedPhotosAlbum;
  
      }
      else
      {
          picker.sourceType=UIImagePickerControllerSourceTypeCamera;
      }
  
      [self presentModalViewController:picker animated:YES];
  
  }
  
  -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
  {
      [picker dismissModalViewControllerAnimated:YES];
      imagedisplay.image=[info objectForKey:@"UIImagePickerControllerOriginalImage"];
  
  }
  </code></pre>
  
  <p>but in this code run time error like</p>
  
  <p>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Source type 1 not available'</p>
  
  <p>so give any suggestion and source code which is apply in my code</p>