iphone - How to call Notification from another class -
iphone - How to call Notification from another class -
i seek phone call notification class
// in classa
- (void)ondidfinishlaunchingnotification:(nsnotification*)notification { nslog(@"ondidfinishlaunchingnotification"); } calling notification class // in class b
[[nsnotificationcenter defaultcenter]addobserver:nil selector:@selector(ondidfinishlaunchingnotification:) name:nil object:nil];
in class a, add together self observer of notification name
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(ondidfinishlaunchingnotification:) name:yourondidfinishlaunchingnotificationname object:nil]; and in class b, utilize -postnotificationname:object: post notification:
[[nsnotificationcenter defaultcenter] postnotificationname:yourondidfinishlaunchingnotificationname object:nil]; iphone ios
Comments
Post a Comment