【发布时间】:2016-05-29 07:13:28
【问题描述】:
我是 xcode 的新手,所以我在学习有关在 xcode 7 中将网页放入 ios Objective-c 项目的教程。下面是我使用的代码。 @interface ViewController ()
查看控制器标题
@interface ViewController : UIViewController
IBOutlet UIWebView* webView;
@property (nonatomic, retain) UIWebView *webView;
@end
view controller main
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@synthesize webView;
@end
错误警告是;
1.不能在@interface或@protocol'中声明变量
2.Attribute只能应用于实例变量或属性
两者都适用于以 IBOutlet 开头的第一行
【问题讨论】:
-
你使用故事板吗?还是您想以编程方式添加 web 视图?
标签: ios objective-c iphone xcode uiwebview