【发布时间】:2010-02-19 15:20:56
【问题描述】:
我有这个方法……
- (void) helloThere: (int) myValue {
// I am trying to pass myValue to animationDidStop
[UIView beginAnimations:nil context:[NSNumber numberWithInt: myValue]];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
[UIView setAnimationDelegate:self];
// do stuff
[UIView commitAnimations];
}
然后我正在尝试在 animationDidStop 上检索 myValue...
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
int retrievedValue = (int)context; //??? not giving me the right number
}
但 retrievedValue 给了我一个与原始 myValue 无关的数字...
如何找回那个号码?
感谢您的帮助。
【问题讨论】:
标签: iphone iphone-sdk-3.0