2012-07-26 70 views
1

当我试图编译我的代码,这段代码:@interface为“UIAlertView中”

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"You Lost!" 
    message:[NSString stringWithFormat:@"You were hit! Try again!"] 
    delegate:nil 
    cancelButttonTitle:@"Dismiss" otherButtonTitles:nil]; 
[alert show]; 

是有这个错误:
No Visible @interface for 'UIAlertView' declares the sector

+0

请不要对正常的文本和代码使用粗体/斜体我们已经格式化了sta ndards。另外,请不要恢复有效的修改。 – Polynomial 2012-07-26 13:36:30

+0

@Polynomial:我加回了他的回复并格式化得更好,因为你的回复删除了包含错误的代码。 – Liron 2012-11-21 11:34:02

回答

1

http://www.raywenderlich.com/forums/viewtopic.php?t=3312&p=20213

您有一个额外的t in cancelButttonTitle。Should be cancelButtonTitle。

+0

谢谢嘘!哈哈我甚至没有看到额外的't' – user1553626 2012-07-26 13:16:01

+0

是的,你可以盯着那样的东西几个小时。 – Liron 2012-07-26 13:16:48

+0

您可以将此标记为已获批准的答案吗?一般而言,您应该在本网站上标记为已批准的答案,或者人们不太愿意帮助您处理将来的请求。 – Liron 2012-08-02 11:15:20