0
我正在调用一个包含在控制器类中的方法,该方法必须更改视图。它在insertsubview.view上产生一个错误。如何解决它?感谢您从当前menuViewController类来自另一个类的调用方法在xcode上产生SIGABRT错误
电话:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
aboutTabController * myObject = [[aboutTabController alloc] init];
if (indexPath.section == 1) {
switch (indexPath.row) {
case 0:
[myObject turnIdioma];
break;
case 1:
//
break;
default:
break;}
}
}
//method implememented in controller class:
- (void) turnIdioma
{
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
if (self.controladorAjustes == nil)
{
settingsViewController *aController = [[settingsViewController alloc] initWithNibName:@"mailViewController" bundle:nil];
self.controladorAjustes = aController;
[aController release];
}
[UIView setAnimationTransition: UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.controladorMenu viewWillDisappear:YES];
[self.controladorAjustes viewWillAppear:YES];
[self.controladorMenu.view removeFromSuperview];
[self.view insertSubview:controladorAjustes.view atIndex:0];
[self.controladorMenu viewDidDisappear:YES];
[self.controladorAjustes viewDidAppear:YES];
[UIView commitAnimations];
}
在将它作为子视图插入之前,请检查controladorAjusted.view的值。它可能是零吗? –
是的,它是零。方法执行时,必须移除调用该方法的类的视图,这是否会成为问题? – Ruth85
好的,解决了,只是在调用xib的时候!名字不正确。谢谢。 – Ruth85