Why doesn't the following code work?
MyViewController *viewController = [[MyViewController alloc] init];
[myWindow addSubview:viewController.view];
[viewController release];
As I understand, myWindow
should be retaining viewController.view
for as long as the window needs it. So why does this cause my app to crash on launch? (commenting out the last line fixes the problem, as expected)