-7
-(void)end{
NSLog(@"End Called");

}    

UIImage *bPin = [UIImage imageNamed:@"BluePin.png"];
        UIImage *gPin = [UIImage imageNamed:@"GreenPin.png"];
        UIImage *rPin = [UIImage imageNamed:@"RedPin.png"];
        UIImage *yPin = [UIImage imageNamed:@"YellowPin.png"];
        UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0,0,bPin.size.width,bPin.size.height)];
        image.animationImages = [NSArray arrayWithObjects:
                                 bPin,
                                 rPin,
                                 gPin,
                                 yPin,
                                 nil];

        image.animationRepeatCount = 0;
        image.animationDuration = 1.0;
        [image startAnimating];

        [image setFrame: CGRectMake(point.x-(image.bounds.size.width/2), point.y-(image.bounds.size.width/2), image.bounds.size.width, image.bounds.size.height)];
        [self.view addSubview: image];



        [UIView animateWithDuration:2.0 delay:1.0 options:UIViewAnimationOptionCurveLinear  animations:^{
            [image setAlpha:0.0];
        } completion:^(BOOL finished) {
            [image removeFromSuperview];

        }];

我想将图像发送到 void end 方法,但我该怎么做?我需要在那里结束它以便为某个图像设置动画......我该如何发送它??????

4

2 回答 2

3

我没有看到问题是什么(也没有看到这个问题与 Xcode 有什么关系),为什么不简单地

- (void)end:(UIImage *)img
{
    // do stuff
}

并称它为

[self end:imageView.image];

?

于 2012-09-17T16:31:02.750 回答
0

将您的结束方法更新为这样

- (void) end:(UIImageView *)imageToAnimate {
     NSLog(@"end called");
}

然后调用它:

[self end:image];
于 2012-09-17T16:33:11.410 回答