任何人有任何想法这意味着什么,以及如何整理出来?声明失败 - [UIActionSheet showInView:]
*断言故障 - [UIActionSheet showInView:],/SourceCache/UIKit_Sim/UIKit-1912.3/UIActionSheet.m:4630 2012-03-02 17:12:34.643策略&风险[66854 :15803] *终止应用程序由于 未捕获的异常 'NSInternalInconsistencyException',原因是: '无效的参数并不令人满意:查看=零!'
更新:它只是发生零星:
更新2:我没有在我的应用程序标签栏或工具栏
更新3:我已经改变使用showInView代码:和我得到完全相同的错误信息。
- (void)displayAddEntityActionSheet {
//Convert the tap location to this view's coordinate systems
CGRect buttonTappedRect = [self.currentNodeView convertRect:self.currentNodeView.frame toView:self.view];
UIActionSheet *actionSheet;
switch (self.currentNode.nodeType) {
case NodeTypeEntity:
actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:nil
destructiveButtonTitle:nil otherButtonTitles:@"Entity", @"Objective", nil] autorelease];
[actionSheet showFromRect:buttonTappedRect inView:self.view animated:YES];
break;
case NodeTypeObjective:
actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:nil
destructiveButtonTitle:nil otherButtonTitles:@"Risk", @"KPI", nil] autorelease];
[actionSheet showFromRect:buttonTappedRect inView:self.view animated:YES];
break;
case NodeTypeRisk:
actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:nil
destructiveButtonTitle:nil otherButtonTitles:@"KRI", @"Control", nil] autorelease];
[actionSheet showFromRect:buttonTappedRect inView:self.view animated:YES];
break;
case NodeTypeControl:
actionSheet = [[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:nil
destructiveButtonTitle:nil otherButtonTitles:@"KCI", nil] autorelease];
[actionSheet showFromRect:buttonTappedRect inView:self.view animated:YES];
break;
default:
break;
}
}
你能告诉我们你创建actionSheet的代码吗? – EmilioPelaez 2012-03-02 16:39:14
除非您发布一些代码,否则我们无法说出任何内容。 – akashivskyy 2012-03-02 16:52:34
@TheLearner请参考我的回答,我认为答案会帮助你解决这个断言失败。 – 2012-03-02 16:53:58