始终保存从scrollview到相册的第一张图像

时间:2012-10-10 20:28:22

标签: iphone ios6

为什么我只选择第一张图像从滚动视图到相册,当我选择第二张图像或任何其他图像时,它始终只保存从滚动视图到相册的第一张图像

- (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;
} }}

它应该始终保存所选图像。

请帮忙。

由于

0 个答案:

没有答案