我后移动到10.12/Sierra和Xcode的8.1撞我的头靠在一个奇数错误:琐碎 “+ [的NSTimer scheduledTimerWithTimeInterval:重复:块:]:无法识别选择” 错误
+[NSTimer scheduledTimerWithTimeInterval:repeats:block:]:
unrecognized selector sent to class 0x7fff78f1fa88
最最小代码(创建一个新项目的默认设置)重现此:
// AppDelegate.m
//
#import "AppDelegate.h"
@interface AppDelegate()
@property (weak) IBOutlet NSWindow *window;
@property (strong, nonatomic) NSTimer * timer;
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
self.timer = [NSTimer scheduledTimerWithTimeInterval:10
repeats:YES
block:^(NSTimer * _Nonnull timer)
{
NSLog(@"Ping from %@", timer);
}];
}
链接包括(核心)基础类和'all_load'。必须是完全微不足道的东西 - 但不能达到目的。
任何和所有的帮助表示赞赏。
谢谢,
Dw。
不管它的价值,这些代码不会崩溃,我(10.12.1时,Xcode 8.1)。 –