Reputation: 313
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(requestAddressUpdatedNotification:)
name:MTAddressUpdatedNotification
object:nil];
Can anyone tell me what will happen if I write this piece of code in my program ?
And when will the method requestAddressUpdatedNotification
be called?
Upvotes: 0
Views: 78
Reputation: 1022
The code informs the default NSNotificationCenter
to notify your object (self
) when a MTAddressUpdatedNotification NSNotification
occurs and to trigger requestAddressUpdatedNotification:
method which must be defined (within @implementation…@end
) in the same class.
Upvotes: 4