I'm fairly new to iPhone programmer but hope someone can answer this simple questions.
I have pushed a new UIViewController which has a TableView.
My .h file looks like this:
I then have two problems when pushing this UIViewController on the stack.
I use a .nib file but even though I have made the tableview only fill half the size of the screen from IB it seems to fill out the whole screen in iPhone simulator. Why is that?
Another problem is that I want to push a new UIViewController from this TableView. I do that with this code:
My problem is that the code line with :
does not seem to be working.
When I return from the new UIViewController the row is still selected?
Any help is highly appreciated
Rolf
I have pushed a new UIViewController which has a TableView.
My .h file looks like this:
Code:
@interface SetUpGameViewController : UIViewController {
UITableView *tableView;
NSMutableArray *array;
}
@property (retain, nonatomic) UITableView *tableView;
@property (nonatomic, retain) NSMutableArray *array;
@end
I then have two problems when pushing this UIViewController on the stack.
I use a .nib file but even though I have made the tableview only fill half the size of the screen from IB it seems to fill out the whole screen in iPhone simulator. Why is that?
Another problem is that I want to push a new UIViewController from this TableView. I do that with this code:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic -- create and push a new view controller
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
if ([[array objectAtIndex:indexPath.row] isEqual:@"Set up players"])
{
SetUpGameViewController *set_up_players = [[SetUpGameViewController alloc] initWithNibName:@"PlayerSettingsViewController" bundle:Nil];
[self.navigationController pushViewController:set_up_players animated:YES];
[set_up_players release];
}
}
My problem is that the code line with :
Code:
deselectRowAtIndexPath
When I return from the new UIViewController the row is still selected?
Any help is highly appreciated
Rolf