开发者

How to navigate to a nib(view) when a cell is pressed on a UITableView(on another nib/view)?

开发者 https://www.devze.com 2023-01-07 10:19 出处:网络
I want the functionality similar to the last tabs in a tab bar (those that are shown in a table after pressing the \"...\")

I want the functionality similar to the last tabs in a tab bar (those that are shown in a table after pressing the "..." )

Each points to another view.

My table

page a>

page b>

page c>

I guess that the code sh开发者_开发技巧ould be in didSelectRowAtIndexPath but

  1. I dont know how to call a nib based on the table
  2. I dont know if after navigating to the next nib ... I'll be able to navigate back

Thanks Asaf


copy&paste from random project:

-(void)navigateToFAQ
{
    UIViewController *faqBrowser = [[UIViewController alloc] autorelease];
    [faqBrowser initWithNibName:@"faqBrowser" bundle:nil];

    // EDIT: sorry, leave this out this is my own category to UIBarButtonItem!
    //faqBrowser.navigationItem.leftBarButtonItem = [UIBarButtonItem arrowLeftWithText:@"back" target:self action:@selector(dismiss)];

    [self.navigationController pushViewController:faqBrowser animated:YES];
    faqBrowser.title = @"FAQ";
}

-(void)dismiss
{
    [self.navigationController popViewControllerAnimated:YES];
}

call [self navigateToFaq] from your didSelectRowAtIndexPath

and make sure you have a nib file called faqBrowser.xib...

0

精彩评论

暂无评论...
验证码 换一张
取 消