Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-11-2010, 04:14 PM   #1 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Question Tab Bar Won't Switch Until View Finishes Loading

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.
DenVog is offline   Reply With Quote
Old 01-11-2010, 04:38 PM   #2 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 916
Default

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.
lukeca is offline   Reply With Quote
Old 01-11-2010, 04:44 PM   #3 (permalink)
Registered Member
 
Dynno's Avatar
 
Join Date: Jan 2010
Posts: 83
Default

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.

-A.J.
Dynno is offline   Reply With Quote
Old 01-11-2010, 04:52 PM   #4 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by Dynno View Post
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 View Post
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.
DenVog is offline   Reply With Quote
Old 01-11-2010, 05:03 PM   #5 (permalink)
Registered Member
 
Dynno's Avatar
 
Join Date: Jan 2010
Posts: 83
Default

Hmm...

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.

Best regards,

-A.J.
Dynno is offline   Reply With Quote
Old 01-14-2010, 04:00 PM   #6 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 41
Posts: 1,184
Default

Quote:
Originally Posted by DenVog View Post
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.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 01-14-2010, 04:30 PM   #7 (permalink)
Registered Member
 
DenVog's Avatar
 
Join Date: Jan 2009
Location: Silicon Valley, USA
Posts: 622
Default

Quote:
Originally Posted by dljeffery View Post
It sounds like your RSS feed loading operation is simply blocking the main thread... have you tried moving it into its own thread?
Thanks for the suggestion. I'll look into this. FWIW - It's not just the RSS feed. Same thing happens with Web views too.
DenVog is offline   Reply With Quote
Reply

Bookmarks

Tags
tab bar

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 239
15 members and 224 guests
ADY, AragornSG, CKAmike, Dani77, Dattee, Duncan C, HDshot, HemiMG, Promo Dispenser, Punkjumper, Rudy, sacha1996, sneaky, spiderguy84, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:18 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0