iOS:如何通过按下按钮将 mainViewController.XIB 链接到另一个名为 about.XIB 的页面?

发布于 2024-12-20 04:44:59 字数 407 浏览 5 评论 0原文

我的 iPad ViewController.xib 上有一个名为“关于我们”的按钮。如何将该按钮链接到另一个名为“关于我们”的页面。我创建了一个名为 about.xib 的 XIB 文件。我如何链接该页面。我也可以链接回主视图控制器。我需要创建另一个 m 或 h 文件吗?

我已经完成了这段代码,但它不起作用。

- (IBAction) About {
    UIViewController * about = [[UIViewController alloc] initWithNibName:@"About" bundle:nil];
    [self.navigationController pushViewController:about animated:YES];
    [about release];
}

I have my iPad ViewController.xib with a button called about us. How to link that button to another page called about us. I have created one XIB file called about.xib. And how do i link that page. Also can I link back to the main viewController. Do i need to create another m or h files?

I have done this code but it doesn't work.

- (IBAction) About {
    UIViewController * about = [[UIViewController alloc] initWithNibName:@"About" bundle:nil];
    [self.navigationController pushViewController:about animated:YES];
    [about release];
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偏爱你一生 2024-12-27 04:44:59
UIViewController * about = [[UIViewController alloc] initWithNibName:@"About" bundle:nil];
[self presentModalViewController:about animated:YES];
[about release];
UIViewController * about = [[UIViewController alloc] initWithNibName:@"About" bundle:nil];
[self presentModalViewController:about animated:YES];
[about release];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文