I am very new to iPhone development, but I have been given an iPhone application to debug and I don’t know where to start.
The problem is as follows:
The app has a view which has a navigation bar on top. When I press the home button on the device, the application goes to suspended mode I suppose. When I go back to the app from the list I can see the view but without navigation bar. Why would the navigation bar disappear, and how can I fix it?
Here is the code for the same
-(void)viewWillAppear:(BOOL)animated
{
[self prepareNavBar];
}
-(void)prepareNavBar
{
self.navigationItem.hidesBackButton = NO;
CustomNavBar *the_pNavBar = [[CustomNavBar alloc] init];
[the_pNavBar prepareNavbarWithLeftButtonImage:nil leftButtonAction:nil titleImage: [UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_heading_comments.png"]] rightButtonImage:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_submit.png"]] rightAction:@selector(postComment) target:self backgroundImage:[UIImage imageWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"ip4_background_grey_150px.png"]] navigationBar:self.navigationController.navigationBar isStandardNavBar:NO];
[the_pNavBar release];
}
please let me know if any other code is required
I fixed the issue by the following code