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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -