views:

17

answers:

2

i created a navigation based project but instead of tableview i added a new view with a button to navigate to the other view.. my button code is as shown below but whenever i run it the application doesn't run?? is the code wrong or navigation based application only work with tableview??

-(IBAction)clickMe:(id)sender

chdDetails *details=[[chdDetails dalloc]initWithNibName:@"chdDetails" bundle:nil];  
[self.navigationController pushViewController:details animated:YES];    
[details release];
details=nil;
A: 

Is chdDetails an UIViewController or an UIView? You can't push an UIView on an UINavigationController, only controllers.

Espuz
A: 

Hi

It says "[[chdDetails dalloc]initW.... instead of alloc. is that a copy-waste typo?

No a navigationCOntroller will work with any viewController, you don't even need the navigationbar. I bet most application are navigationBased but you don't even see it.

[self.navigationController.navigationBar setHidden:YES]

Will do that.

Try placing a breakpoint in the clickMe method to test if it even gets called. What does this mean: "the application doesn't run??" is there an error message? Have you hooked the button up in IB? Is chdDetails a subclass of UIViewController? etc. etc.

RickiG