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 08-28-2008, 01:10 PM   #1 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 8
Default didSelectViewController and tab bar tutorial

I am trying to implement didSelectViewController using the mdmstudio's tab bar tutorial.
I am try to load data from the net everytime a user clicks on one of the tabbaritems (they shouldnt click it all the time). I need to be able to recognize that event.
I've added the didSelectViewController() to the code and set a break point and nslog, but it never gets to that point.

suggestions???
thanks
b_f20 is offline   Reply With Quote
Old 08-28-2008, 07:12 PM   #2 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 8
Default solution

Found a solution:

-I added tab bar controller's delegate to the custom object
-Added IBOutlet UITabBarController to customcontroller.h

This leads me to a new problem.
How do you get the title of the selected tabbaritem when didSelectViewController() is signaled?

NSString *tabBarItemTitle = selectedviewcontroller.tabbaritem.text; ???
b_f20 is offline   Reply With Quote
Old 10-17-2008, 04:57 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2008
Posts: 21
Default

Hi

The title can be found in viewController.tabBarItem.title

Example

Code:
// Optional UITabBarControllerDelegate method
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
	if ([viewController.tabBarItem.title isEqualToString:@"something"])
    {
        // Do something
    }
	
}

Last edited by corneliussen; 10-17-2008 at 05:00 AM. Reason: Code looked strange
corneliussen is offline   Reply With Quote
Old 02-16-2011, 09:11 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 13
Default

Quote:
Originally Posted by b_f20 View Post
Found a solution:

-I added tab bar controller's delegate to the custom object
-Added IBOutlet UITabBarController to customcontroller.h

This leads me to a new problem.
How do you get the title of the selected tabbaritem when didSelectViewController() is signaled?

NSString *tabBarItemTitle = selectedviewcontroller.tabbaritem.text; ???
I have this same problem. Can you explain how you added the tab bar delegate to the custom object?
willsaake is offline   Reply With Quote
Reply

Bookmarks

Tags
didselectviewcontroller, nstabbar

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: 583
20 members and 563 guests
Arfan, armmzz, bignoggins, BrianSlick, ckgni, dacapo, devangvyas, Duncan C, Hito_kun, learningtocode, linkmx, LiquidFire, MarcoAlmeida, mollysalomons, Monstertaco, oceanlablight, Rudy, soonw29, Vineesh
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,773
Threads: 89,203
Posts: 380,584
Top Poster: BrianSlick (7,129)
Welcome to our newest member, holisticni8
Powered by vBadvanced CMPS v3.1.0

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