【问题标题】:@interface for 'UIAlertView"“UIAlertView”的@interface
【发布时间】:2012-07-26 13:00:46
【问题描述】:

当我试图编译我的代码时;这段代码:

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

【问题讨论】:

  • 请不要对普通文本和代码使用粗体/斜体。我们有格式标准。另外,请不要还原有效的编辑。
  • @Polynomial:我添加了他的回复并更好地格式化它,因为您的回复删除了包含错误的代码。

标签: xcode4 interface xcode4.2 uialertview


【解决方案1】:

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

您在 cancelButtonTitle 中有一个额外的 t。应该是 cancelButtonTitle。

【讨论】:

  • 非常感谢!!哈哈,我什至没有看到多余的't'
  • 是的,你可以盯着这样的东西看几个小时。
  • 您可以将此标记为已批准的答案吗?一般来说,您应该将本网站上的答案标记为已批准,否则人们不太愿意帮助您处理未来的请求。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-05
相关资源
最近更新 更多