I have a UITabBarController which is switching between tabs just fine. The only issue I have is that sometimes it takes up to 3 seconds to respond (call didSelectViewController).
This only occurs when I am switching between pages with quite a few elements, UIViews and UILabels and such. It is instant to respond when it doesn’t have any views to add and remove.
I think that it should call didSelectViewController before doing anything else on receiving a touch, but this does not seem to be the case. Does anyone have any suggestions as to how I can speed up my app?
Thanks
I expect your app is taking a long time to render the view. I suggest stepping through the
viewWillAppear:method to see if you are running a slow query or doing something else that takes a lot of time when the view is shown. If so, you might be able to use a cache or show a placeholder page while that is happening. If the app is slow because you really do have so manyUIViews, think about using a custom-rendered view instead, or aUITableViewand only loading the sub views as they are needed.In iPhone OS 3.0 has
tabBarController:shouldSelectViewController:which gets called after the touch, but before the tab is actually selected.