I have an issue with selecting a method for a notification.
In the init I have definied this:
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(stopSyncIndicator:) name:IOS_STOP_SYNC_INDICATOR object:nil];
The method is definied though, both in header and same implementation:
-(void)stopSyncIndicator
{
[indicator stopAnimating];
}
However when a different class is posting this notification:
NSNotification *note = [NSNotification notificationWithName:IOS_STOP_SYNC_INDICATOR object:nil];
[[NSNotificationCenter defaultCenter] postNotification:note];
The hell breaks loose:
[FTRecordViewController stopSyncIndicator:]: unrecognized selector sent to instance 0x8d3bc00
2013-11-18 13:47:06.994 [1835:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FTRecordViewController stopSyncIndicator:]: unrecognized selector sent to instance 0x8d3bc00'
*** First throw call stack:
(
0 CoreFoundation 0x01bf75e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x018f88b6 objc_exception_throw + 44
2 CoreFoundation 0x01c94903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
Any idea what is going on here?