generalzyq
generalzyq

Reputation: 313

What's the meaning of this piece of code?

[[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

Answers (1)

Global nomad
Global nomad

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

Related Questions