标签: iphone uiviewcontroller uiscrollview
applicationDidFinishLaunching方法中的代码是
applicationDidFinishLaunching
self.view = UIScrollView
为什么这不起作用?
答案 0 :(得分:1)
因为您无法将类分配给UIView类型的Objective-C属性;您必须在将对象分配给属性之前实例化该类。试试这个:
self.view = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];