2013-06-13 37 views
1

它說的UIAlertView中沒有明顯的@interface declears選擇

的UIAlertView中沒有明顯的@interface declears選擇 「initWithTtile:消息....

這是我有─

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Error %@, here is your error", [error description]] delegate: nil cancelbuttonTitle:@"Cancel" otherButtonTitles:nil, nil]; 
+0

@Alexander這與錯誤沒有任何關係。 – rmaddy

+0

方法名稱區分大小寫。仔細檢查你的拼寫。並始終使用Xcode方法名稱完成。它避免了這樣的簡單錯誤。 – rmaddy

+0

checlk我的回答對你真的很有幫助... – Jitendra

回答

-1

這表明,由於該方法是不正確

使用

UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Error" 
          message:[NSString stringWithFormat:@"Error %@, here is your error", [error description]] 
          delegate:self 
          cancelButtonTitle:@"Cancel" 
          otherButtonTitles:nil, nil]; 
+1

-1對於未指出你改變 – borrrden

+0

我認爲它是一個一行代碼和它並不需要太多的解釋 –

+0

這是一個很長的線和變化是很微妙的。 – borrrden

-1

initWithTtle是寫在你的錯誤 - 應該是標題沒有Ttle

+0

這並不告訴OP如何解決他們使用的實際代碼。 – rmaddy

+0

是用標題 –

+1

代替Ttle但是在實際的方法調用中OP正確地具有'initWithTitle:'。這不是問題。 – rmaddy

6

的問題是在cancelbuttonTitle應該是上限。像cancelButtonTitle

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:[NSString stringWithFormat:@"Error %@, here is your error", [error description]] delegate: nil cancelButtonTitle:@"Cancel" otherButtonTitles:nil, nil]; 
相關問題