Sending message to viewController in Tab Based Application (iphone iOS) -
i have method called getcurrentcycle in 1 of viewcontrollers use in tab based application. call method applicationdidbecomeactive app delegate method.
can me out this?
check out nsnotification class reference.
in controller has getcurrentcycle method, add following:
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(getcurrentcycle:) name:@"getcurrentcycle" object:nil]; when want call getcurrentcycle, add this:
[[nsnotificationcenter defaultcenter] postnotificationname:@"getcurrentcycle" object:nil]; also, need change getcurrentcycle to:
- (void)getcurrentcycle:(nsnotification *)notification
Comments
Post a Comment