Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 12-11-2011, 11:16 PM   #1 (permalink)
Registered Member
 
Join Date: Dec 2011
Posts: 1
antuks is on a distinguished road
Default UIViewController to UITableViewController

I have an app that starts with Login page which using UIViewController. Upon click of button will run buttonpressed method which will call the page with Table View. It's running okay on the first level of Tableview but when it click the list on the view it didn't show the details. I tried to make Table View as my start page, that is without the login page and it's running fine. Not sure what I did wrong, please help.

Here's the method when button click:

- (void)loginButtonPressed
{

UITableViewController *myLoginViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
[self presentModalViewController:myLoginViewController animated:NO];
[myLoginViewController release];

}
antuks is offline   Reply With Quote
Old 12-11-2011, 11:35 PM   #2 (permalink)
Registered Candy Bar
 
DrBeak1's Avatar
 
Join Date: Nov 2010
Location: San Jose, CA
Posts: 298
DrBeak1 is on a distinguished road
Default

You'll probably need to clarify more than that to get any support. But I'll give it a shot.

So you have three UIViewControllers: 1) LoginViewController 2) TableViewController and 3) DetailViewController, correct?

If your goal is to (a) have the user tap on the login button located on LoginViewController, which loads the TableViewController. Then (b) from TableViewController the user taps a tableViewCell and that pushes the DetailViewController. I would use the following code:

Code:
//in LoginViewController///////////////////////////////////////////////////
-(void)loginButtonTapped
{
     if (self.tableView == nil) {
          TableViewController *t = [TableViewController alloc] initWithNibName:"TableViewController" bundle:nil]];
          self.tableView = t;
          [t release];
     }
     [self presentModalViewController:self.tableView animated:NO];

//then use the delegate method in the tableView to call the detailView////
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
     	if (self.detailView ==nil) {
		DetailViewController *d = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
		self.detailView = d;
		[d release];
				
	}

	 [self.navigationController pushViewController:self.detailView animated:YES];
}
DrBeak1 is offline   Reply With Quote
Reply

Bookmarks

Tags
mainwindow, uitableviewcontroller, uiviewcontroller

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: 405
14 members and 391 guests
7twenty7, AppsBlogger, Creativ, David-T, Duncan C, HemiMG, heshiming, LunarMoon, Murphy, pbart, sacha1996, Sami Gh, teebee74, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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