gpt4 book ai didi

iOS 代码正在加载错误的 nib 文件?

转载 作者:行者123 更新时间:2023-11-28 17:43:27 25 4
gpt4 key购买 nike

我有一个列表应用。当您点击一个列表项时,它会加载一个专门用于该单元格的单独 Nib 。第二个 nib 有两个按钮,每个按钮都与另一个 nib 文件相关联。这段代码在我的 Cell1.m 文件中的第一个实现可以很好地打开 Nib 以响应在详细 View 内按下的按钮,没有错误/变暖:

-(IBAction)wikibuttonPressed:(id)sender {
WebView1 *detailvc = [[WebView1 alloc] initWithNibName:@"WebView1" bundle:nil];
[detailvc setTitle:@"Wikipedia"];
[self.navigationController pushViewController:detailvc animated:YES];
[detailvc release];

}

-(IBAction)biobuttonPressed:(id)sender {
WebView2 *detailvc2 = [[WebView2 alloc] initWithNibName:@"WebView2" bundle:nil];
[detailvc2 setTitle:@"The White House"];
[self.navigationController pushViewController:detailvc2 animated:YES];
[detailvc2 release];
}

但是,当我尝试在 Cell2.m 上实现此代码时,而不是加载此代码:

-(IBAction)biobuttonPressed:(id)sender {
WebView4 *detailvc4 = [[WebView4 alloc] initWithNibName:@"WebView4" bundle:nil];
[detailvc4 setTitle:@"The White House"];
[self.navigationController pushViewController:detailvc4 animated:YES];
[detailvc4 release];
}


-(IBAction)wikibuttonPressed:(id)sender {
WebView3 *detailvc3 = [[WebView3 alloc] initWithNibName:@"WebView3" bundle:nil];
[detailvc3 setTitle:@"Wikipedia"];
[self.navigationController pushViewController:detailvc3 animated:YES];
[detailvc3 release];

}

它加载与我的第一段代码(WebView1 和 WebView2,而不是 WebView3 和 WebView4)关联的 nib 文件。此外,我在 Cell2.m 上收到一条警告,指出未定义 bioButtonPressed 和 wikiButtonPressed。我做错了什么?

最佳答案

检查这些方法的定义是否与 Cell2.h 匹配,并且导出设置是否正确。

关于iOS 代码正在加载错误的 nib 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7154754/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com