【发布时间】:2016-06-09 13:57:43
【问题描述】:
我是 Xcode(7.3) 和 ios(9.3) 的新手。我尝试了一个示例项目来显示警报消息,但出现如下错误:
“'UIAlertController' 没有可见界面声明'show'。Belo 我附上了代码。
//ViewController.m//
UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
message:@"This is an alert."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];
[alert show];
//AppDelegate.h//
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end.
请帮帮我。
【问题讨论】:
-
提示 - 在
UIAlertController的文档中,您是否看到show的方法?
标签: ios objective-c cocoa-touch uikit uialertcontroller