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 06-15-2009, 03:34 PM   #1 (permalink)
New Member
 
Join Date: May 2009
Location: St. Louis, MO
Posts: 17
Question Tab Bar Application - didSelectItem

Hello,
I'm trying to acheive something like this..
I have a one SQLite table that has list of drinks. The tab bar application will have 3 tabs. Cold, Coffee, Tea. I do not want to load all the data when the app launches. I just want to select only the data corresponding to the Tab. For, eg. if somebody selects "Cold" tab, I would like to populate a Tableview with the data from the table that corresponds to "Cold" drinks

What is the best way to do?

This is what I was trying to do
I'm new to iPhone SDK and ObjC. I created a new Project (Tab Bar Application), Removed "SecondView.nib" (Created by defaulted) Added 2 Tab Bar Items.
I want to find out which Tab Bar item was selected.

Code:
@interface TabBarTestAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate, UITabBarDelegate>

in implementation

@implementation TabBarTestAppDelegate
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
	NSLog(@"Did Select Here");
}
In Interface builder, I linked the "Tab Bar" delegate (Clicked on Tab bar in MainWindow.xib) "Tab Bar Test App Delegate". When I click on different tabs, I don't see the text in the log. I have no clue what is going on. Any help in the regard is much appreciated

Thanks
Newbie09 is offline   Reply With Quote
Old 06-15-2009, 03:51 PM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Location: Germany
Posts: 16
Send a message via ICQ to danilkazzz
Default

Why don't you just create 3 nibs: cold.xib, tea.xib and so on, make separate UITableViewController Classes, set the right class to the right .xib in IB and connect the view of a tab bar item with the right xib?
danilkazzz is offline   Reply With Quote
Old 06-15-2009, 04:07 PM   #3 (permalink)
New Member
 
Join Date: May 2009
Location: St. Louis, MO
Posts: 17
Post

Quote:
Originally Posted by danilkazzz View Post
Why don't you just create 3 nibs: cold.xib, tea.xib and so on, make separate UITableViewController Classes, set the right class to the right .xib in IB and connect the view of a tab bar item with the right xib?
Thanks Danilkazzz. Will the memory size of the App be more if I created 3 Nibs? I thought acheiving this with one MainWindow.xib will save memory. Also, there is only one SQL table. Do you still think that is the best way to do it?
Newbie09 is offline   Reply With Quote
Old 04-29-2010, 11:23 AM   #4 (permalink)
Registered Member
 
Join Date: Apr 2010
Location: Banglore, Karnataka, INDIA
Posts: 21
Default

Quote:
Originally Posted by Newbie09 View Post
Hello,
I'm trying to acheive something like this..
I have a one SQLite table that has list of drinks. The tab bar application will have 3 tabs. Cold, Coffee, Tea. I do not want to load all the data when the app launches. I just want to select only the data corresponding to the Tab. For, eg. if somebody selects "Cold" tab, I would like to populate a Tableview with the data from the table that corresponds to "Cold" drinks

What is the best way to do?

This is what I was trying to do
I'm new to iPhone SDK and ObjC. I created a new Project (Tab Bar Application), Removed "SecondView.nib" (Created by defaulted) Added 2 Tab Bar Items.
I want to find out which Tab Bar item was selected.

Code:
@interface TabBarTestAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate, UITabBarDelegate>

in implementation

@implementation TabBarTestAppDelegate
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
	NSLog(@"Did Select Here");
}
In Interface builder, I linked the "Tab Bar" delegate (Clicked on Tab bar in MainWindow.xib) "Tab Bar Test App Delegate". When I click on different tabs, I don't see the text in the log. I have no clue what is going on. Any help in the regard is much appreciated

Thanks


Hi in IB, connect the delegate and referencing outlets options of tabbar. then ur "Did Select Here" message will be displayed
saba518 is offline   Reply With Quote
Old 10-11-2011, 07:23 AM   #5 (permalink)
Registered Member
 
Join Date: Oct 2011
Posts: 2
Default

Quote:
Originally Posted by saba518 View Post
Hi in IB, connect the delegate and referencing outlets options of tabbar. then ur "Did Select Here" message will be displayed

Hi mate, In the delegate file, I create two tabbar items, and connect each of them to the nib items, and did the UITablebarDelegate, and implement the didselect method,

however, it doesn't work?
klokand is offline   Reply With Quote
Reply

Bookmarks

Tags
tab bar application, tab bar problem

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: 255
24 members and 231 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, dre, glenn_sayers, HemiMG, JasonR, LEARN2MAKE, M.A.S., marshusensei, mer10, nobre84, Oral B, prchn4christ, Raggou, Rudy, spiderguy84, themathminister
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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