I write a simple ios app. All of my views are created programmatically. Here is some code
rootViewController.m
-(void)loadView
{
UIView *view = [[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame];
self.view = view;
self.view.backgroundColor = [UIColor greyColor];
}
In appDelegate I add rootViewController view to the window and everything work fine. But if expression
self.view = view
is removed rootViewController is not loaded in window. Why is this happening ?