UILongPressGestureRecognizer добавляется в мой imageView с дескриптором действияLongPressOnPhotos. Наиболее связанные коды следующие:
- (IBAction)handleLongPressOnPhotos:(UIImageView *)sender{
self.imageWillBeSaved = sender;
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Save the photo" otherButtonTitles: @"Go to the Original photo", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[actionSheet showInView:self.view];
[actionSheet release];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
switch (buttonIndex) {
case 0:
UIImageWriteToSavedPhotosAlbum(self.imageWillBeSaved.image, self, @selector(image: didFinishSavingWithError:contextInfo:), nil);
break;
default:
break;
}
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if (error != NULL)
{
// handle error
}
else
{
// handle ok status
}
}
При нажатии кнопки «сохранить фотографию» на листе действий появляется сообщение об ошибке: -[UILongPressGestureRecognizer image]: нераспознанный селектор отправлен экземпляру 0x21c2a0. Есть проблемы в коде? Заранее спасибо!