为什么当我一直选择第二张或任何其他图像时它只将第一张图像从滚动视图保存到相册
- (void)handleLongPress:(UILongPressGestureRecognizer*)gestureRecognizer{
//CGPoint gesturePoint = [_gesture locationInView:_imageScrollView];
if (gestureRecognizer.state == UIGestureRecognizerStateBegan){
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Save Photo", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
[actionSheet showInView:self.view];
[actionSheet release];
}}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0:
for (int i = 0; i<=61; i++) {
NSString *imageName = [NSString stringWithFormat:@"image%d.png", i];
UIImage *image = [UIImage imageNamed:imageName];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
//if (CGRectContainsPoint(_myButton.frame,gesturePoint)){
UIImageWriteToSavedPhotosAlbum(imageView.image, self, @selector(image: didFinishSavingWithError:contextInfo:), nil);
break;
default:
break;
} }}
它应该始终保存选定的图像。
请帮忙。
谢谢