ios - viewWillAppear not called in subordinate view -


I have a UIViewController that loads a subview from a nibb and it is in a subview Adds Hierarchy Now it's all working well on the iPhone Story Board, but in an iPad I see the footage but viewWillAppear is not called UIImageView is not initial

The code from the main view controller (which loads a subview)

  subsystem controller * controller = [[SubViewController alloc] init]; NSArray * bundle = [[NSBundle mainBundle] loadNib nominated: @ "x"] owner: controller option: zero]; UIView * Subway = Bundle [0]; [Self addChildViewController: controller]; If (isPhone) {CGR frame; Frame.origin.x = 0; Frame.origin.y = 0; Frame.Size = self.scrollView.frame.size; View.frame = frames; [Self.scrollView addSubview: view]; } And {view.frame = self.viewSlot.frame; [Self.viewSlot addSubview: view]; }  

The only difference on the iPhone is that it is added to UIScrollView , while on iPad it is added to UIView .

Scene slot and scrollw are both outlets that work properly and work even on the iPad, I see my view ( I've changed its background color) It does not just run the initialization ( viewWillAppear ).

After a little bit of playing, I have been able to reach the bottom. First of all, I decided to start the controller in a different way:

  subview controller * controller = [[SubviUI controller alloc] initWithNibName: [@ "X" stringbapping string: idiocry] bundle: zero] ;  

I have an exception that found the problem: The view outlet was not set up. Text of this story: Do not just use alloc - init , use initWithNibName initialiser. It is still strange that the difference between some iPhone / iPad has not yet been received, as it has still worked on the iPhone.


Comments