I am banging my head against an odd error after a move to 10.12/Sierra and Xcode 8.1:
+[NSTimer scheduledTimerWithTimeInterval:repeats:block:]:
unrecognized selector sent to class 0x7fff78f1fa88
The most minimal code (default settings of create a new project) to reproduce this is:
// 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);
}];
}
The linking includes the (Core)Foundation classes and 'all_load'. Must be something totally trivial - but fail to what it is.
Any and all help appreciated.
Thanks,
Dw.
+[NSTimer scheduledTimerWithTimeInterval:repeats:block:] is an iOS 10.0+ method. Are you maybe trying to run it on iOS 9.x?
https://developer.apple.com/reference/foundation/nstimer/2091889-scheduledtimerwithtimeinterval?language=objc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With