Is there any way to automatically call a custom method when switching views usig a UITabBarController? Like, I want to he able to, when I set a NSString in one view in a UILabel, haave it automatically update a different label on a different tab with the same string. Thank you!
Yes, take a look at the UITabBarControllerDelegate protocol. All you have to do is register your object as the tab bar delegate and implement the
didSelect callback (the
didSelect would be better a better choice). The callback will get called each time the tab bar switches.
Take a look at
UITabBarControllerDelegate. Implement that method in your delegate and do whatever updating you need to do in there.