我正在尝试使用以下代码为我的自定义视图的移动设置动画(我最好的翻译来自苹果自己的文档的objective-c)
var animDict = new NSMutableDictionary ();
animDict [NSViewAnimation.TargetKey] = this.View;
animDict [NSViewAnimation.StartFrameKey] = NSValue.FromRectangleF (this.View.Frame);
animDict [NSViewAnimation.EndFrameKey] = NSValue.FromRectangleF (new RectangleF (0, 150 * index, 400, 150));
var theAnim = new NSViewAnimation ();
theAnim.SetValuesForKeysWithDictionary (animDict);
theAnim.Duration = 2;
theAnim.StartAnimation ();
但是,在运行应用程序时出现以下运行时错误: 2011-05-08 00:53:30.827 EpisodeNext[61715:613] [ setValue:forUndefinedKey:]: 此类与键 NSViewAnimationTargetKey 的键值编码不兼容.
知道我做错了什么吗?谢谢!