任何人有任何想法這意味着什麼,以及如何整理出來?聲明失敗 - [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