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

Featured Member Applications

TanZen ($0.99)

Endless Walls ($0.99)

Air Hockey ($0.99)

SUPER STRIKE - Motion Bowl ($0.99)

BarSlot ($0.99)

MeterRead ($0.99)

Colorblind Helper ($4.99)

gContacts ($1.99)

ProgCalc ($1.99)

Forex On The Go Lite (FREE)

HUE knewit! ($0.99)

Want your application to be advertised here?

» Advertisements


Visit our friends over at The App Show! Steve and Dave produce a weekly show shining a light on the iPhone 2.0 software and the applications being developed by the amazing development community for the iPhone SDK!
» Online Users: 79
13 members and 66 guests
acdc, fordracerguy, ihuangeri, ipodtouchmaster05, Kent, millisecond, mwt, nownot, rbmac, Reflejo, snatch, tappedOut, WayneDavidDaley
Most users ever online was 207, 10-24-2008 at 09:29 AM.
» Stats
Members: 3,916
Threads: 5,625
Posts: 23,285
Top Poster: scottiphone (705)
Welcome to our newest member, wdmcclendon
Reply
 
LinkBack Thread Tools Display Modes
Old 08-28-2008, 01:10 PM   #1 (permalink)
Junior Member
 
Join Date: Aug 2008
Posts: 7
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)
Junior Member
 
Join Date: Aug 2008
Posts: 7
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)
Junior Member
 
Join Date: Aug 2008
Posts: 13
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
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
Forum Jump

Powered by vBadvanced CMPS v3.0.1

All times are GMT -5. The time now is 07:10 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0