0
내가 처음있는 NSInvocation를 사용하기 위해 노력하고있어
은, 아래의 코드는 유래에서 다른 응답 코드에서 채택된다.
타이머는 잘 실행하지만, 실제로 만료 될 때 충돌과 (animationEnd :)에서 코드를 실행(아이폰)있는 NSInvocation 충돌 문제
UIImageView* animationView = [animationViewArray objectAtIndex: i];
[self.imageView addSubview: animationView];
[animationView startAnimating];
// [NSTimer scheduledTimerWithTimeInterval: 5.5 target: self selector: @selector(animationEnd:) userInfo: animationView repeats: NO];
SEL selector = @selector(animationEnd:);
NSMethodSignature *signature = [self methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setSelector:selector];
//The invocation object must retain its arguments
// when passing to timer, it's ok
// [animationView retain];
//Set the arguments
[invocation setTarget:self];
[invocation setArgument:&animationView atIndex:2];
[NSTimer scheduledTimerWithTimeInterval:0.1 invocation:invocation repeats:NO];
-(void) animationEnd:(NSInvocation*) invocation
{
UIImageView* animationView = nil;
[invocation getArgument:&animationView atIndex:2];
[animationView removeFromSuperview];
[animationView release];
}
?
이 충돌 로그를 바탕으로, (animationEnd :)에서 호출처럼 보이는 것은 내가 호출에 전달 된 인수 자체입니다.
혼란 STUF ..
감사합니다.