how to retain view after addSubview of UIViewController with ARC
问题 How to handle situation when I use ARC and add view of UIViewController? MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; [someView addSubview:vc.view]; //this retain vc.view because addSubview retain onlu view, not controller, so controller is released. Before ARC there was a way to retain controller as long as neede, but how to prevent ARC to release View Controller? 回答1: I had similar situation solved by declaring vc as property with default