1

in My Application there is one galary. i dont know what to put in image(UIImage *image) part of the UIImageWriteToSavedPhotosAlbum Method and I wann save image in iphone photo album. I am using this code

- (void)savePhoto
{
    UIImageWriteToSavedPhotosAlbum(((IndicatorImageView *)[self._imageViews objectAtIndex:_selectedImage])._imageView.image, nil, nil, nil);

}

but it shows this error...

2012-10-26 18:48:00.596 PhotoGallery[2683:15203] -[GalleryItemView _imageView]: unrecognized selector sent to instance 0x8e7cc90 2012-10-26 18:48:00.665 PhotoGallery[2683:15203] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GalleryItemView _imageView]: unrecognized selector sent to instance 0x8e7cc90' * First throw call stack:

Please help me if u know this... thanks in advance...

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
Sam
  • 431
  • 7
  • 23

3 Answers3

0
UIImageWriteToSavedPhotosAlbum(YOUR_IMAGE(UIImage), self, @selector(finishUIImageWriteToSavedPhotosAlbum:didFinishSavingWithError:contextInfo:), nil);
SachinVsSachin
  • 6,401
  • 3
  • 33
  • 39
  • Thanks bro... but the question is UiImage is placed in another class and in this class i have to get it... so please write the syntex or link to give that... – Sam Oct 26 '12 at 14:17
0

Here is the code you need. You need to pick the imageview.image.....not the actual image variable.

- (IBAction)saveImageButton:(id)sender {
UIImageWriteToSavedPhotosAlbum(_processedImageView.image, nil, nil, nil);
}
0
- (void)savePhoto
{
    UIImageWriteToSavedPhotosAlbum(((IndicatorImageView *)[self.imageViews objectAtIndex:_selectedImage]).image, nil, nil, nil);
}

If your array self._imageViews contain imageViews , why you try to access _imageViewagain??

also , Is _imageViews a property? use self.imageViews is better.

johnMa
  • 3,291
  • 24
  • 37
  • i solved this months ago but then also you told right thing. so i am accepting your answer for others.. – Sam Dec 23 '13 at 06:13