I have a Tab Bar app (combined with Navigation Controller if it matters). I have found that the tabs will not switch until after the view in the currently selected tab has finished loading.
EXAMPLE
Tab 1 is a table populated from an RSS feed. If I touch Tab 2 while the feed in Tab 1 is loading, nothing happens. Once the view in Tab 1 has finished loading, I can switch to Tab 2 with no trouble.
This seems to be true regardless if my tab is a table view, web view, etc. Anything that takes time to completely display the contents. I thought that maybe this was just a limitation of Tab Bar controllers, but I have used other apps that will switch tabs regardless whether or not the current view has finished loading.
Can anyone offer insight to what I am doing wrong? Thanks.
Well it's not something I have delved into yet, but I am pretty sure you need to look at using multiple threads. Otherwise all of your code is running on one thread along with the gui. The gui can't be updated then until the other code is finished.
I'm far from experienced here and my suggestion might be moot, but what method are you calling your view from? For example, are you using viewDidLoad? The only reason I ask is that you might be loading all the views at the same time once the nib is loaded since you're probably loading everything from MainWindow.xib.
If thats the case, you might want to try viewWillAppear instead of viewDidLoad.
I just finished creating a Tab Bar app and I don't have any of the problems you mention.
I'm far from experienced here and my suggestion might be moot, but what method are you calling your view from? For example, are you using viewDidLoad?
Yes. Most of my views are using ViewDidLoad
Quote:
Originally Posted by Dynno
The only reason I ask is that you might be loading all the views at the same time once the nib is loaded since you're probably loading everything from MainWindow.xib.
Hmm. I don't think that is the case, if I follow what you're saying. When it switches to tab 2, or 3, I can see each of them loading. Both the data in the view and my activity indicator. If they were all loading at the same time, I would think they would display instantly once their tab was selected.
That's interesting. I'm not sure what to tell you. Hopefully somebody that's more knowledgeable than me can help you out. Sorry for not being of any assistance.
Tab 1 is a table populated from an RSS feed. If I touch Tab 2 while the feed in Tab 1 is loading, nothing happens. Once the view in Tab 1 has finished loading, I can switch to Tab 2 with no trouble.
It sounds like your RSS feed loading operation is simply blocking the main thread... have you tried moving it into its own thread?
__________________ Recall It!Tag your notes. Tag your photos. Tag your thoughts. Tag your life.