在UIViewController类中,我有一个tableView通过点击navBar按钮来调用它
-(IBAction) addButtonPressed:(id)sender {
CreateQuestionController *createQuestionViewController = [[CreateQuestionController alloc] initWithNibName:@"CreateQuestionController" bundle:nil];
[self.navigationController pushViewController:createQuestionViewController animated:YES];
[createQuestionViewController release];
}
这个方法在我的代码中没有其他地方被调用。嗯,当我点击这个navBar按钮和视图显示,我发现ViewDidLoad方法被调用两次(这是正常的在这种情况下),但我在这里输入的数据丢失了。下面是我的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
textView.text=@"Type your question here";
NSLog(@"Question text:%@", textView.text);
}
日志:2011-07-11 10:56:35.727 HelpMe[1343:207] Question text:Type your question here
2011-07-11 10:56:35.728 HelpMe[1343:207] Question text:(null)
怎么回事?谢谢你
编辑:其他症状:—无法推送其他视图-不能更改按钮的图像
我的问题在我的笔尖文件。我删除了控制器并将所有出口分配给文件的所有者