Help me please. Wrote application with UINavigationController . When you click on the button does not work the transition to another page. I understand that I give little information about the problem. But everything seems to be set up. I have Xcode 3.2.5. I used the book "Application development for iphone ipad and ipod touch using ios sdk ", chapter 9. By the way, I recommend it to everyone very well. I did everything right. A hundred times checked.


 DisclosureButtonController *disclosureButtonController= [[DisclosureButtonController alloc] initWithStyle:UITableViewStylePlain]; disclosureButtonController.title=@"Название"; disclosureButtonController.rowImage=[UIImage imageNamed:@"disclosureButtonControllerIcon.png"]; [array addObject:disclosureButtonController]; [disclosureButtonController release]; 
  • Give the code to press the button, it will be clearer. - aknew
  • I do not see in your use code navigation in general, in theory there should be something like [self.navigationController pushViewController: disclosureButtonController animated: YES]; before release. Also, it is not at all clear what the array is. The code is better to insert into the question, it is very difficult to understand it in the comments - aknew
  • Well, you asked only the button code ... The code that you gave is written in the class - Sergey4590
  • so this is the transition to another page that does not work for you. Is the class big? Can you give him the whole thing? - aknew
  • @ Sergey4590, hello. > written in class Honestly, it is not clear exactly where it was written. Is it logical that the transition code should be in the method (aka function) of the button? - VioLet

1 answer 1

Maybe something I do not catch up, but the whole way was

 -(void)method { ViewController1 *v1Class = [[ViewController1 alloc] initWithNibName:@"ViewController1" bundle:nil]; v1Class.navigationItem.title = @"Detail view"; [self.navigationController pushViewController:v1Class animated:YES]; [v1Class release]; } 

UPD: In the method - (void) viewdidload {} should be prescribed

 UIBarButtonItem *anotherButton = [[UIBarButtonItem alloc] initWithTitle:@"Show" style:UIBarButtonItemStylePlain target:self action:@selector(method)]; self.navigationItem.rightBarButtonItem = anotherButton; [anotherButton release]; 

UPD2: in AppDelegate

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease]; } else { self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease]; } UINavigationController *navController=[[UINavigationController alloc]initWithRootViewController:self.viewController]; self.window.rootViewController = navController; //self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; } 
  • You will be the fourth who is trying to beat the author of the topic :) - aknew
  • Hmm, it's time to write a book, an Objective-c course for a young programmer. - x86-64
  • Have you read this link? - Enough already to wait, that you will bring everything on a saucer with a blue border. Turn on the go and google. - Tuggen
  • one
    @ Sergey4590, if you can not understand the material that is chewed to the simplest and in which a bunch of screenshots, then, sorry, you'd better not do programming. Do not torture yourself and do what you get. - Tuggen
  • 2
    Does not give no error ??? Have you tried the answer described above ??? - x86-64