I have a timer which was started by main thread. From timer handler I am sending notification In 1 out of 5 cases, I get EXC_BAD_ACCESS when the post notification code is executed.
//Registering Notification
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(TestNotification:)
name:@"TestNotification" object:nil];
//Starting timer
timer = [NSTimer scheduledTimerWithTimeInterval:2
target:self
selector:@selector(timerhandler:)
userInfo:nil
repeats:YES];
//Posting notification from timer handler
[[NSNotificationCenter defaultCenter]
postNotificationName:@"TestNotification" object:nil];
Can someone help.
增 编