I’d like to run a method when a user switches to another tab or when the application is closed. Is there a way to do this with the iphone sdk?
I’ve tried looking at the methods for the view controllers and the tab bars, but I didn’t see any methods that seemed to do this.
I’ve also tried doing this with ‘Editing Did End’ methods, but that didn’t seem to work.
To run a method when a tab is tapped (and I’m assuming you’re referring to a standard UITabBar), just implement
tabBar:didSelectItem:in your tabBar’s delegate.To run code when your application quits, implement
applicationWillTerminate:in your app’s delegate.