开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜