开发者

Why is my code to change a UIViewController's View to a UIScrollView not working

开发者 https://www.devze.com 2022-12-16 07:15 出处:网络
my code inside of the applicationDidFinishLaunching method is self.view开发者_Go百科 = UIScrollView

my code inside of the applicationDidFinishLaunching method is

self.view开发者_Go百科 = UIScrollView

Why is this not working?


Because you can't assign classes to Objective-C properties of type UIView; you have to instantiate the class before assigning the object to the property. Try this:

self.view = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 480.0)];
0

精彩评论

暂无评论...
验证码 换一张
取 消