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 02-10-2009, 03:35 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 109
Unhappy How to Implement a UITableView from a non-navigation template

Hi,
I am new to iPhone development, and I created a new project from a window-based application because none of the other templates fit what I want my app to do. What I want is I want two views, one will have a very simple game on it, and on the other view will be a navigation-based table view where I will put the settings. I created a UITableViewController and a UITableViewCell subclass in my XCode project, but I was wondering where in Interface Builder I should put the navigation controller. Should I put it in the window, or in the Settings View? Also, is there anything special I have to do to get this to work? Thanks.
brian515 is offline   Reply With Quote
Old 02-10-2009, 03:37 PM   #2 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 47
Default

Put it in the settings view
chevoldavis is offline   Reply With Quote
Old 02-10-2009, 03:48 PM   #3 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 109
Default Thanks

Thanks for your fast reply. Will the Navigation controller automatically link to the table view I put in, or how do I do that?
brian515 is offline   Reply With Quote
Old 02-10-2009, 03:53 PM   #4 (permalink)
Registered Member
 
Join Date: Jan 2009
Posts: 47
Default

In IB just make sure you are adding the tableview to the navigation controller element. I think I am understanding your question correctly.
chevoldavis is offline   Reply With Quote
Old 02-10-2009, 04:43 PM   #5 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 109
Default

Quote:
Originally Posted by chevoldavis View Post
In IB just make sure you are adding the tableview to the navigation controller element. I think I am understanding your question correctly.
Yes, that would be my question. So, if I have to add the tableView to the navigation controller element, do I just tell my method that switches views, located in my app delegate class to switch to the navigation controller view?

Right now my code is this to switch to the settings view.
Code:
-(void)flipToSettings {
	SettingsViewController *settingsView = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil];
	[self setSettingsViewController:settingsView];
	[settingsView release];
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:1.5];
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
	[gameViewController.view removeFromSuperview];
	[self.window addSubview:[settingsViewController view]];
	[UIView commitAnimations];
}
So would that become this?
Code:
-(void)flipToSettings {
	SettingsViewController *settingsView = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil];
	[self setSettingsViewController:settingsView];
	[settingsView release];
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:1.5];
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
	[gameViewController.view removeFromSuperview];
	[self.window addSubview:[settingsViewControllerNavigationController view]];
	[UIView commitAnimations];
}
brian515 is offline   Reply With Quote
Reply

Bookmarks

Tags
controller, table, tableview, uitableview, view

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: 243
14 members and 229 guests
ADY, CKAmike, Dani77, dessicant, Duncan C, HemiMG, jakerocheleau, nick.keroulis, Promo Dispenser, Punkjumper, Rudy, sacha1996, sneaky, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
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 03:22 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0