Results 1 to 2 of 2
Discuss Navigation Controller Pointer for UITableView at the iPhone Developer Exchange - Hackint0sh.org; What I am trying to do is to make the Application Delegate Navigation Controller the ...
  1. #1
    Newbie Array

    Join Date
    Sep 2010
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Navigation Controller Pointer for 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];



  2. #2
    Newbie Array

    Join Date
    Sep 2010
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    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;

 

 

Similar Threads

  1. help me regarding UITableView.
    By nat.iphone in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 05-12-2010, 08:01 AM
  2. How to prevent Navigation Controller from Poping View
    By slammers in forum iPhone Developer Exchange
    Replies: 2
    Last Post: 10-13-2008, 06:12 PM
  3. UITableView: Need a help
    By Neshta in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 07-29-2008, 09:56 AM
  4. [Dev] UITableView, if anyone can assist
    By rbenjamin in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 04-21-2008, 09:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 07:56 PM.
twitter, follow us!