title: UIImageWriteToSavedPhotosAlbum is not saving image to photo album
body: <p>I m trying to save image from scrollview to photo album when user long press on image, action sheet shows up with save photo button and when hitting save button it is not saving image to photo album </p>
  
  <pre><code> - (void)viewDidLoad
  
  {    self.view.backgroundColor = [UIColor blackColor];
  UIScrollView *imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
  imageScrollView.pagingEnabled = YES;
  NSInteger numberOfViews = 61;
  for (int i = 0; i &lt; numberOfViews; i++) {
      CGFloat xOrigin = i * self.view.frame.size.width;
      UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
  
      [myButton addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
  
      myButton.frame = CGRectMake(xOrigin, 10, 60, 35);
  
      //[myButton addGestureRecognizer:tap];
  
      [myButton.layer setMasksToBounds:YES];
  
      [myButton.layer setCornerRadius:10.0f];
  
      myButton.layer.borderWidth = 2;
  
      myButton.layer.borderColor = [[UIColor whiteColor] CGColor];
  
      [myButton setTitle:@"Done" forState:UIControlStateNormal];
  
      myButton.backgroundColor = [UIColor clearColor];
  
      NSString *imageName = [NSString stringWithFormat:@"image%d.png", i];
      UIImage *image = [UIImage imageNamed:imageName];
      UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
      _imageView.tag = 128;
      imageView.frame = CGRectMake(xOrigin, 0, self.view.frame.size.width, self.view.frame.size.height);
  
  
      UILongPressGestureRecognizer *gestureRecognizer = [[UILongPressGestureRecognizer alloc]
                                                         initWithTarget:self
                                                         action:@selector(handleLongPress:)];
  
      //imageScrollView.userInteractionEnabled = YES;
      [imageScrollView addGestureRecognizer:gestureRecognizer];
      gestureRecognizer.delegate = self;
      [gestureRecognizer release];
  
      [imageScrollView addSubview:imageView];
      [imageScrollView addSubview:myButton];
  
      //[imageView release];
  
  }
  imageScrollView.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size.height);
  
  [self.view addSubview:imageScrollView];
  [imageScrollView release];
   }
  
  
  
   -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  switch (buttonIndex) {
      case 0:
      [_imageScrollView viewWithTag:128];
      UIImageWriteToSavedPhotosAlbum(_imageView.image, self, @selector(image: didFinishSavingWithError:contextInfo:), nil);//When i add breakpoint at this statement in result it shows storage zero but alert view says success photo got saved in photo album
  
          break;
  
      default:
          break;
  }
  }
  
  - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
   {
  if (error != NULL)
  {
  
      alert = [[UIAlertView alloc] initWithTitle:@"Error"
                                         message:@"Unable to save image to Photo Album."
                                        delegate:self cancelButtonTitle:@"Ok"
                               otherButtonTitles:nil];
       } else{
          alert = [[UIAlertView alloc] initWithTitle:@"Success"
                                             message:@"Image saved to Photo Album."
                                            delegate:self cancelButtonTitle:@"Ok"
                                   otherButtonTitles:nil];
      [alert show];
      [alert release];
     }
     }
  </code></pre>
  
  <p>Please help.</p>
  
  <p>Thanks</p>