Home News Forum Social Networking Support Us Advertise

Spanish Lesson 1 ($1.99)

aWake!Gently ($1.99)

The Bird & The Snail - Knock Knock - Deluxe ($4.99)

Match-It Trains ($0.99)

Tangled ($0.99)

iFlatter ($0.99)

The 15 puzzle ($0.99)

Tap Forms Database ($8.99)

Higher or Lower Card Game (Hi Lo) ($0.99)

Red Pixel ($0.99)

Time-Shift Radio ($0.99)

Want your application advertised here? Only $10/week!

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)
Junior Member
 
Join Date: Aug 2008
Posts: 8
Rep Power: 0
b_f20 is on a distinguished road
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)
Junior Member
 
Join Date: Aug 2008
Posts: 8
Rep Power: 0
b_f20 is on a distinguished road
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)
Junior Member
 
Join Date: Aug 2008
Posts: 20
Rep Power: 0
corneliussen is on a distinguished road
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


» Advertisements


» Stats
Members: 8,229
Threads: 20,197
Posts: 90,213
Top Poster: RickMaddy (2,121)
Welcome to our newest member, jrsiqueira
Powered by vBadvanced CMPS v3.1.0

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