A UIViewController
adds itself to the default center:
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(editFood)
name:@"editFood"
object:nil];
Then a UITableView
delegate NSObject posts a NSNotification
:
[[NSNotificationCenter defaultCenter]
postNotificationName:@"editFood"
object:self];
During run time it get a EXC_BAD_ACCESS exception.
Is the defaultCenter
getting released somewhere? The same concept works when I post a notification to a UIViewController from a UIViewController, but that shouldn't matter, right?
[[NSNotificationCenter defaultCenter] removeObserver:self]
to-(void)dealloc{}
method in your Scene will probably solve this problem for you. It worked for me; I was having the same problem you were. Good luck! – Mistassini