Management of the ios-controller

Source: Internet
Author: User

if the 2 controller's view is the parent child relationship, then these 2 controllers should also be the parent child relationship? [Vc01.view AddSubview:vc02.view];? [Vc01 ADDCHILDVIEWCONTROLLER:VC02];?//adds VC02 to the vc01.childviewcontrollers array//vc01.childviewcontrollers-@[vc02]1>through the Addchildviewcontroller method, it is possible to display the small controller into a controller? [Self Addchildviewcontroller:[[hmoneviewcontroller alloc] init];? [Self Addchildviewcontroller:[[hmtwoviewcontroller alloc] init];? [Self Addchildviewcontroller:[[hmthreeviewcontroller alloc] init];?2>Declare in the????????????????????? controller [email protected] (nonatomic, weak) Uiviewcontroller*SHOWINGCHILDVC;?3>need to provide a? method to switch the sub-controller?//Index: The indexes of the sub-controllers that will need to be displayed??- (void) SWITCHVC: (int) index? {    ?//1. Remove the child controller view currently being displayed?    [Self.showingChildVc.view Removefromsuperview]; ?//2. Add the view of the index position corresponding to the controller? Uiviewcontroller *NEWVC =Self.childviewcontrollers[index]; ? newVc.view.frame= CGRectMake (0, -, Self.view.frame.size.width,? self.view.frame.size.height- -); ?    [Self.view AddSubview:newVc.view]; ? SELF.SHOWINGCHILDVC=newvc;?} does not establish a parent-child control of its possible consequences inside? A small controller may send the following conditions:1>The law detects that more significant system events have been born (such as screen rotation events)?2> May cause Self.navigationcontroller = = Nil, Self.tabbarcontroller = =nil?3> may cause [self dismissviewcontrolleranimated:yes completion:nil] effect (unable to shut down controller)

Management of the ios-controller

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.