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 09-14-2009, 10:43 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 9
Default Trigger IBAction with UITabBarItem?

Hello,
I'm fairly new to iphone development but I'm learning quickly. I have an application that uitilizes two UITableViewControllers and a UITabBarController to switch between the two views. Each view loads and parses a remote XML file and displays it in a table view. The problem I'm running into is that when hitting the tab for the second view,it takes about 10 seconds to parse the XML file, during which the whole interface is frozen and unresponsive. I have an IBAction setup to display a "Loading" overlay message but can't seem to trigger it when the user selects the second tab bar item. (I know the loading overlay action works, I utilize it elsewhere in the application)

Ideally, I would love to get the XML data loading asynchronously so that the user doesn't have to wait until the whole document is done parsing before they can use the app (I've spent hours trying to use the code from the Seismic-XML example but so far, absolutely no luck). I'll settle for a loading overlay just so they don't think it locked up.

Any ideas? I've created most of the views programatically (not a huge fan of IB except for very simple interfaces)
tspitznas is offline   Reply With Quote
Old 09-14-2009, 10:51 AM   #2 (permalink)
iPhone Developer
 
kohjingyu's Avatar
 
Join Date: May 2009
Location: Singapore
Posts: 326
Default

You can use

Code:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
I THINK you can do something like:

Code:
 (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
     if(tabBarController == tabBarName)
     {
          //Do something
     }
}
But I'm not sure.

The reference is here: iPhone Dev Center: UITabBarControllerDelegate Protocol Reference

Hope that helps.
__________________
Bacteria Bash
Cheese Collect
Jokestar
Follow me on Twitter for news about my apps:
(Website|Twitter)
kohjingyu is offline   Reply With Quote
Old 09-14-2009, 11:15 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 9
Default

Quote:
Originally Posted by kohjingyu View Post
You can use

Code:
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
I THINK you can do something like:

Code:
 (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
     if(tabBarController == tabBarName)
     {
          //Do something
     }
}
But I'm not sure.

The reference is here: iPhone Dev Center: UITabBarControllerDelegate Protocol Reference

Hope that helps.
I will give that a shot! Thanks
tspitznas is offline   Reply With Quote
Old 10-12-2009, 08:37 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 9
Default

Quote:
Originally Posted by tspitznas View Post
I will give that a shot! Thanks
This did seem to work but I since figured out a better way to load the data before the view is loaded so there is no latency in the UI. Thanks!
tspitznas is offline   Reply With Quote
Reply

Bookmarks

Tags
ibaction, uitabbarcontroller, uitabbaritem, xml

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: 331
22 members and 309 guests
@sandris, ADY, BrianSlick, dacapo, Dani77, Dattee, dre, HDshot, HemiMG, JasonR, MarkC, mer10, nibeck, prchn4christ, ryandb2, spiderguy84, themathminister, timle8n1, tomtom100, vogueestylee, vvenkatachallam
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,883
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, vvenkatachallam
Powered by vBadvanced CMPS v3.1.0

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