【发布时间】:2013-01-04 05:51:25
【问题描述】:
我已将 UINavigationbar 和 UIscrollView 添加到 UIView(SecondView)。当我单击 firstView 中的按钮时,它应该将我带到 secondView。 点击按钮:
SecondView *secondview=[[SecondView alloc]initWithNibName:@"SecondView" bundle:nil];
[self presentModalViewController: secondview animated:NO]; //error at this line
[secondview release];
在secondView.h中
@property(nonatomic,retain)IBOutlet UINavigationBar *navigationBar;
@property(nonatomic,retain)IBOutlet UIScrollView *testscroll;
SecondView.m:
@synthesize navigationBar,testscroll;
但我收到如下错误:
由于未捕获的异常“NSUnknownKeyException”而终止应用程序,原因:SecondView setValue:forUndefinedKey:]:此类不符合键导航栏的键值编码。
我的 secondView.xib 是这样的:
不明白我哪里出错了?
【问题讨论】:
-
[self presentModalViewController: secondview animated:yes];.. 可能会起作用,如果你想推送那个类,你必须写... [self.navigationController pushViewController:secView animated:YES ];
-
@Sudha 他不是要那个
标签: iphone xcode uinavigationbar