Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Table view controller hiding tabbar controller and navigation controller

Hello, i have a view controller who has as input text and and a button. That navigation view is the first item of the tab bar controller. When the user presses the button i want a table view to come up but below the tab bar controller and the navigation controller title. Here is my problem the table view just hides all of them. The tab bar controller and the view controller are made through .xib but the table view controller is made in code. I have no loadview method. Do you think that i have to manipulate table view there and how can i do so?



thanks in advance.

mac book pro 13.3'', Mac OS X (10.6.5), nope

Posted on Oct 14, 2011 2:09 AM

Reply
1 reply

Oct 14, 2011 10:49 AM in response to ZaaBI_AlonSo

well here are some parts of my code


first view controller is made through a nib file and it's code is here :


[CODE

#import "FirstViewController.h"


//#import "ResultsViewController.h"


@implementation FirstViewController


@synthesize textField,navigationController;

@synthesize resultsViewController;


-(IBAction)searchButtonPressed:(id)sender{



//RootViewController *temp = [[RootViewController alloc]init];


//[self pushViewController:temp animated:YES];

[selfpresentModalViewController:resultsViewControlleranimated:YES];


}



-(IBAction)textFieldDoneEditing:(id)sender{

[sender resignFirstResponder];

}


-(IBAction)backgroundTap:(id)sender{

textField.resignFirstResponder;

}


/*

// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {

// Custom initialization

}

return self;

}

*/



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.

- (void)viewDidLoad {

[superviewDidLoad];





}



/*

// Override to allow orientations other than the default portrait orientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO rientation {

// Return YES for supported orientations

return (interfaceOrientation == UIInterfaceOrientationPortrait);

}

*/


- (void)didReceiveMemoryWarning {

// Releases the view if it doesn't have a superview.

[superdidReceiveMemoryWarning];


// Release any cached data, images, etc that aren't in use.

}


- (void)viewDidUnload {

[superviewDidUnload];

// Release any retained subviews of the main view.

// e.g. self.myOutlet = nil;

}



- (void)dealloc {


textField.release;

[super dealloc];

}



@end

[/CODE]



and here is my root controller


[code]


@implementation RootViewController


@synthesize tmpCell, data;



#pragma mark -

#pragma mark View controller methods


- (void)viewDidLoad

{

[superviewDidLoad];



self.navigationController.navigationBar.tintColor = [UIColordarkGrayColor];



// Configure the table view.

self.tableView.rowHeight = 73.0;

self.tableView.backgroundColor = DARK_BACKGROUND;

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;



// Load the data.

NSString *dataPath = [[NSBundlemainBundle] pathForResource:@"Data"ofType:@"plist"];

self.data = [NSArrayarrayWithContentsOfFile:dataPath];

self.cellNib = [UINib nibWithNibName:@"IndividualSubviewsBasedApplicationCell" bundle:nil];

}


- (void)viewDidUnload

{

[superviewDidLoad];



self.data = nil;


self.tmpCell = nil;

}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

{

returnYES;

}



#pragma mark -

#pragma mark Table view methods


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

{

return 1;

}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{

return [data count];

}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

static NSString *CellIdentifier = @"ApplicationCell";


ApplicationCell *cell = (ApplicationCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];


if (cell == nil)

{

cell = [[[CompositeSubviewBasedApplicationCellalloc] initWithStyle:UITableViewCellStyleDefault

reuseIdentifier:CellIdentifier] autorelease];


}



// Display dark and light background in alternate rows -- see tableView:willDisplayCell:forRowAtIndexPath:.

cell.useDarkBackground = (indexPath.row % 2 == 0);



// Configure the data for the cell.

NSDictionary *dataItem = [data objectAtIndex:indexPath.row];

cell.icon = [UIImage imageNamed:[dataItem objectForKey:@"Icon"]];

cell.publisher = [dataItem objectForKey:@"Publisher"];

cell.name = [dataItem objectForKey:@"Name"];


return cell;

}


- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath

{

cell.backgroundColor = ((ApplicationCell *)cell).useDarkBackground ? DARK_BACKGROUND : LIGHT_BACKGROUND;

}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

[tableViewdeselectRowAtIndexPath:indexPath animated:YES];

}



#pragma mark -

#pragma mark Memory management


- (void)dealloc

{

[data release];

[tmpCellrelease];


[super dealloc];

}


@end

[/code]

Table view controller hiding tabbar controller and navigation controller

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.