【发布时间】:2023-03-26 00:12:01
【问题描述】:
NSAnimationContext 中的setCompletionHandler 方法对我不起作用。我正在使用 Apple 文档中的代码:
[NSAnimationContext setCompletionHandler:^{
// This block will be invoked when all of the animations
// started below have completed or been cancelled.
NSLog(@"All done!");
我有以下错误:没有已知的选择器'setCompletionHandler:'的类方法
当我查看此方法旁边的NSAnimationContext.h 文件时,有#if NS_BLOCKS_AVAILABLE 和NS_AVAILABLE_MAC(10_7)。我的部署目标是“10.7”,但是我不知道如何检查NSBlocks 是否可用。还是问题出在其他地方?
【问题讨论】:
标签: objective-c xcode macos objective-c-blocks