我想用CATransition
初始化NSNumber
的持续时间,我该怎么做,因为animation.duration
是NSTimeInterval
个对象?
- (void)startPopUpAnimation:(NSNumber *)numbers {
CATransition *animation = [CATransition animation];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.type = kCATransitionFade;
animation.duration = @"2.15";//[NSNumber numberWithDouble:[numbers doubleValue]];
}
答案 0 :(得分:0)
这比我想象的要容易:
animation.duration
是typedef double
,所以我刚刚做了:animation.duration = [numbers doubleValue];