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 05-15-2009, 02:31 PM   #1 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default Tab Bar Based Application & UITableView

Hello!

This is a second version of my original post because I understood a few thing (confusion between navigation controller and tab bar items)!

Ok so my problem is to create a table view as a tab bar item, and when I click on an item of the table, a detailled view appears, but keeps the tab bar at the bottom of the screen!

To do it, I have implemented a FirstViewController which is a UITableViewController, and a DetailViewController which is also a table view controller.

In IB, I have selected the first item and associated the FirstViewController nib file and I have implemented the didSelectRowAtIndexPath like below :

Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   	if(detailOfferController == nil)
		detailOfferController = [[DetailOfferViewController alloc] initWithNibName:@"OfferDetailView" bundle:[NSBundle mainBundle]];
	
	Offer *anOffer = [assuranceApplicationDelegate.offers objectAtIndex:indexPath.row];
	
	detailOfferController.anOffer = anOffer;
	
	[self.parentViewController presentModalViewController:detailOfferController animated:YES];
}
By this method, I can see the detailled view but it takes the whole screen. How can I keep the tab bar on the bottom and display the detailled view instead the firstView.

Thank you for your help with that, and sorry my english (I'm french).

Last edited by Knuckles; 05-15-2009 at 06:23 PM.
Knuckles is offline   Reply With Quote
Old 05-15-2009, 04:09 PM   #2 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 3
Default

I don't understand why nothing happens (neither view nor errors) but i think you may need to signify somewhere that your table view is controlled by a NavigationController, either added from the IB, or by class maybe?
jqtruong is offline   Reply With Quote
Old 05-15-2009, 04:33 PM   #3 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default

I did, I created a DetailOfferController which I linked in IB with the File's Owner of the DetailView.nib. I also have linked the TableView contained in this view to the controller.

The thing that I don't understand is that no errors or exception are thrown...
Knuckles is offline   Reply With Quote
Old 05-15-2009, 04:53 PM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 3
Default

I meant this line here

Code:
[self.navigationController .... ]
you call the navigationController but i was wondering if you added that navigationController in your mainWindow.xib or created one dynamically perhaps?

...unless every view controller has a navigation controller by default...
jqtruong is offline   Reply With Quote
Old 05-15-2009, 05:03 PM   #5 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default

Quote:
Originally Posted by jqtruong View Post
I meant this line here

Code:
[self.navigationController .... ]
you call the navigationController but i was wondering if you added that navigationController in your mainWindow.xib or created one dynamically perhaps?

...unless every view controller has a navigation controller by default...
I'm not expert (I'm programming for iPhone for 3 days now) but i think each view controller has a navigation controller by default. That's what I understood reading different tutorials, but maybe I'm wrong. I didn't declared it in the MainWindow.xib.

My MainWindow.xib represents my tab bar item (with two categories) and I have created two xib for each view and a xib for the detailled view of the first one (this is the detailled view I can't display)
Knuckles is offline   Reply With Quote
Old 05-15-2009, 05:20 PM   #6 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default

My navigation controller doesn't contain any controller. I thought it would be containing my FirstViewController.. I don't understand.
Knuckles is offline   Reply With Quote
Old 05-15-2009, 05:30 PM   #7 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default

If replace the self.navigationController pushViewController by a self presentModalViewController, my view is displayed but take the whole screen, I want to keep the categories on the bottom.
Knuckles is offline   Reply With Quote
Old 05-16-2009, 09:18 AM   #8 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 3
Default

i think if you added a navigationController and pushed the view like you did before it'll give you the desired effect...

but back to getting that fixed, do you have access to the UICatalog sample code from Apple's iPhone dev center? Among others, it reveals how to add a navigationController.
jqtruong is offline   Reply With Quote
Old 05-16-2009, 10:54 AM   #9 (permalink)
New Member
 
Join Date: May 2009
Posts: 37
Default

Quote:
Originally Posted by jqtruong View Post
i think if you added a navigationController and pushed the view like you did before it'll give you the desired effect...

but back to getting that fixed, do you have access to the UICatalog sample code from Apple's iPhone dev center? Among others, it reveals how to add a navigationController.
Thank your for your help! I have succeded by adding a navigation controller to my first view in the tab bar item and that worked! (Before, I was using my firstViewController, that's the reason why it didn't work!)

Problem solved
Knuckles is offline   Reply With Quote
Reply

Bookmarks

Tags
detail view, tab bar application, uitableview

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: 259
23 members and 236 guests
ADY, AragornSG, bookesp, chillyh, dacapo, Dani77, Davey555, Desert Diva, Dominus, 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:29 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0