UILongPressGestureRecognizer가 handleLongPressOnPhotos 액션을 사용하여 imageView에 추가되었습니다. - [UILongPressGestureRecognizer 이미지] :UIImageWriteToSavedPhotosAlbum을 사용하여 이미지를 저장할 때 인식 할 수없는 선택기 오류
작업 시트의 "사진을 저장"버튼을 클릭- (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
}
}
, 오류 메시지가로 : 가장 관련 코드는 다음과 같습니다 인식 할 수없는 선택기 인스턴스에 전송 0x21c2a0 코드에 문제가 있습니까? 미리 감사드립니다!
어디서 UILongPressGestureRecognizer를 추가 했습니까? 해당 코드도 추가하십시오. – rishi
ok, 잠시 기다리십시오. –
plz에서 다음 답변을 확인하십시오. 문제가 해결되었습니다. –