Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.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, 12: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, 06: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, 03:57 AM   #3 (permalink)
New Member
 
Join Date: Aug 2008
Posts: 20
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 04:00 AM. Reason: Code looked strange
corneliussen 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


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,320
Threads: 39,117
Posts: 171,512
Top Poster: smasher (2,576)
Welcome to our newest member, xX Holllish Xx
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:22 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0