应用一直用storyboard,但是现在需要在xib文件中完成。
我创建了一个单独的视图应用,然后在viewDidLoad
方法中添加下面代码:
UILabel *scoreLabel = [ [UILabel alloc ] initWithFrame:CGRectMake(0, 0.0, 150.0, 43.0) ];
[self addSubview:scoreLabel];
还有这行:
[self addSubview:scoreLabel];
然后报错: No Visible @Interface for 'ViewController' declares the selector 'addSubView
请高手帮忙解决一下,谢谢。
改成 [self.view addSubview:scoreLabel];