ios - Calling a method from another class that removes views -
hi hoping easy answer , because new this.
i trying inside class able remove views exist in class.
in class calling method this.
viewcontroller *viewcontroller = [[viewcontroller alloc] init]; [viewcontroller closenotifiactions];
and in other class here method trying remove views. if place nslog in method called , works, removefromsuperview codes not work.
-(void)closenotifiactions { [spinner removefromsuperview]; [loadingview removefromsuperview]; }
and in .h file reference closenotifications method this: -(void)closenotifiactions;
is there need different make closenotifications part work? thank you!
you can use nsnotification access class properly.
class a:
//create nsnotification
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(closenotifiactions) name:@"notification" object:nil];
class b: //just call nsnotification call method
[[nsnotificationcenter defaultcenter] postnotificationname:@"notification" object:nil];
i hope you.
Comments
Post a Comment