My application delegate contains:
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after app launch window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; if (!window) { [self release]; return; } window.backgroundColor = [UIColor greenColor]; [window addSubview:viewController.view]; [window makeKeyAndVisible]; [window layoutSubviews]; }
This seems to be done without errors. The window variable is NOT 0
, so the if (! window)
Window 0
test does not return a function. However, a window with a green background is not displayed, but only the default color. And in the appController.m file, the code in the viewDidLoad method is executed. However, CGContextRef context = UIGraphicsGetCurrentContext();
returns null, not the real context.
What am I leaving?
source share