254NSNotification Trinity

1

 [[NSNotificationCenter defaultCenter] 
addObserver:self selector:@selector(selectorName:) name:@"methodName" object:nil];

2

[[NSNotificationCenter defaultCenter] 
postNotificationName:@"selectorName" object:self userInfo:nil];

3

- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [super dealloc];
}

52Remove Observer before dealloc

Remove observer before deallocating, otherwise observer accumulate and eventually crash the application.

[[NSNotificationCenter defaultCenter] removeObserver:self];