我尝试了一个简单的应用,将一个视图切换到另一个视图。
但我遇到了一个问题,它显示错误为EXC_BAD_ACCESS THREAD 1
,
我用zombie来检查错误,它显示第一个切换方法的错误,而不是后退方法,这里是切换方法,我无法找到错误。
- (IBAction)YukiBanButtonPress:(id)sender {
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
AboutUs*AboutusController= [[[AboutUs alloc] initWithNibName:@"AboutUs" bundle:nil] autorelease];
[AboutusController setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self.view addSubview:AboutusController.view];
[self.navigationController pushViewController:AboutusController animated:YES];
[AboutusController.view setFrame:self.view.bounds];
[AboutusController setYukiBan];
[AboutusController.navigationItem setTitle:@"YUKI BAN"];
}
这是后退程序
UINavigationItem*item= [NavigationBar.items objectAtIndex:0];
UINavigationItem *back = [[UINavigationItem alloc] initWithTitle:@"Back"];
NSArray *items = [[NSArray alloc] initWithObjects:back,item,nil];
[NavigationBar setItems:items];
[back release];
[items release];
[NavigationBar setDelegate:self];
我该如何解决这个问题?