【发布时间】:2014-04-30 07:46:06
【问题描述】:
这相当于什么可可
[UIView animateWithDuration:2 animations:^{
self.cell.someProperty = 12;
}];
我试过这个,但没有运气
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:2];
[self.animator setSomeProperty:12.0];
} completionHandler:^{
}];
- (void)setSomeProperty:(CGFloat)property {
[self.cell setSomeProperty:property];
[self setNeedsDisplay];
}
我需要为属性设置动画的原因是因为我有一个 NSCell 子类,它根据该属性自行绘制。
【问题讨论】:
-
看不到您发布的内容有任何问题。您可能需要显示更多代码吗?
标签: objective-c macos cocoa core-animation