这很简单,所以我一辈子都找不到问题所在,我查看了文档作为指南,但它仍然没有用。我有一个更大的视图。AnIBAction
应该淡出内部视图......就是这样。这是我所拥有的:
NSViewAnimation *theAnim;
NSMutableDictionary *viewDict;
// Create the attributes dictionary for the view.
viewDict = [NSMutableDictionary dictionaryWithCapacity:2];
// Set the target object to be the view.
[viewDict setObject:_innerView forKey:NSViewAnimationTargetKey];
// Set this view to fade out
[viewDict setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey];
theAnim = [[NSViewAnimation alloc] initWithViewAnimations:@[viewDict]];
// Set some additional attributes for the animation.
[theAnim setDuration:1.0];
// Run the animation.
[theAnim startAnimation];
我检查了viewDict
andtheAnim
并且NSLog
两者都不是nil
。我几乎从一个旧程序中复制了这个程序,现在找不到问题所在。
我正在使用 Xcode 5.1.1。