iPhone SDK Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingiPhone SDK Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 3rd, 2010, 03:12 PM
computerartist computerartist is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2010
Posts: 6 computerartist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 0
Navigation Controller Pointer UITableView

What I am trying to do is to make the Application Delegate Navigation Controller the Navigation Controller for a programmatically inserted tableView (only the view, not the view with navigation controller... if this is possible.



What I was hoping for is that I could do something like the following:


Code:
navController = tableViewAppDelegate.navigationController;




Code:
	tableViewAppDelegate = (TableViewAppDelegate *) [[UIApplication sharedApplication] delegate];

	DetailViewControllerSenateNoTossUp *cnewTableViewFrameController = [[DetailViewControllerSenateNoTossUp alloc] initWithNibName:@"DetailView" bundle:nil];
	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:newTableViewFrameController];
	


	CGRect newTableViewFrame;
	newTableViewFrame.origin.x = 0; 
	newTableViewFrame.origin.y = 0;
	newTableViewFrame.size.height = 200;
	newTableViewFrame.size.width = 280;
	
	UIView *newTableView = [[UIView alloc] initWithFrame: newTableViewFrame];
	newTableView = newTableViewFrameController.view;
	
	[self.view addSubview:newTableViewFrameController.view];

Reply With Quote
  #2  
Old October 6th, 2010, 09:56 AM
computerartist computerartist is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2010
Posts: 6 computerartist User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 0
Here is the full block of code that I got to work:

Code:
	DetailViewControllerSenateNoTossUp *controller = [[DetailViewControllerSenateNoTossUp alloc] initWithNibName:@"DetailView" bundle:nil];
	UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
	navController.view.frame = CGRectMake(0, 0, 320, 416);
	
	[controller release];
	
	CGRect frame;
	frame.origin.x = 0; 
	frame.origin.y = 100;
	frame.size.height = 200;
	frame.size.width = 280;
	
	UIView *try = [[UIView alloc] init];
	try = controller.tableView;
	try.frame = frame;
	
	[self.tableView addSubview:try];
	self.tableView = controller.tableView;
	self.tableView.delegate = self;


The most important part of this is the last three lines. It must also be in that order. 1) Add the new table view to your current view. 2) Set the current table view to equal the new table view. 3) Set the current table as the delegate.

Code:
[self.tableView addSubview:try];
self.tableView = controller.tableView;
self.tableView.delegate = self;

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingiPhone SDK Development > Navigation Controller Pointer UITableView

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap