I recently encountered a problem with the following requirements:
Requirement: There is a separate controller Vc in a storyboard (no link). In storyboard, drag several controls to the VC and customize a class to bind the VC, ask how to obtain this VC and display the page for setting this VC in storyboard. For example:
1. First, you must know the storyboard. First, we will introduce three storyboard methods:
1> the following method indicates that the storyboard name is obtained from a package (generally set to nil to get it from the main package ).
+ (Uistoryboard *) storyboardwithname :( nsstring *) Name bundle :( nsbundle *) storyboardbundleornil
2> This method gets the initial controller in the storyboard.
-(ID) instantiateinitialviewcontroller
3> This method indicates that the controller is obtained through the Controller identifier. The new version of xcode uses the storyboard ID to indicate the identifier of a controller.
-(ID) instantiateviewcontrollerwithidentifier :( nsstring *) identifier;
Well, from the above three methods, many friends should know how to obtain the independent controller in the storyboard.
2. Set the identifier of the independent Vc in the storyboard, that is, the storyboard ID, to distinguish the controller in the storyboard, as shown in
3. Call-instantiateviewcontrollerwithidentifier in storyboard in the class to obtain the independent VC
Zjdulicontroller * Vc = [Self.StoryboardInstantiateviewcontrollerwithidentifier:@ "Duli"]
4. Push or modal output VC.
[Self.NavigationcontrollerPushviewcontroller: VCAnimated:Yes];
The final result is as follows:
Original article, reproduced please indicate the source: http://www.cnblogs.com/Abnerzj/p/3819421.html