ios - How to call function from one viewcontroller to another controller? -
settingsstore.h
@interface settingsstore : iaskabstractsettingsstore { @public nsdictionary *dict; nsdictionary *changeddict; } - (void)removeaccount; @end
menuview.m
-(ibaction)onsignoutclick:(id)sender { settingsstore *foo = [[settingsstore alloc]init]; [foo removeaccount]; [self.navigationcontroller pushviewcontroller:foo animated:yes]; exit(0); }
i want call removeaccount function menuview.m. getting error.
how fix , call removeaccount.
there few mistakes in code please find them below.
- [foo removeaccount]; calling method correct
- [self.navigationcontroller pushviewcontroller:foo animated:yes];
not correct because settingsstore not subclass of uiviewcontroller subclass of uiviewcontroller can pushed navigation controller - exit(0); calling method not recommended apple
Comments
Post a Comment