ipad - Loading a new UIView over the rootUIView on UIButton click from UIPopovercontroller -


my application simple , not using splitview controller. question .. how can load new uiview on root view controller on uibutton click popovercontroller view.

you'll need have root view controller first dismiss popover when button pressed in popover , can present new view root view controller.

for details on how dismissal of popover using button inside popver, see previous answer "how setup popover views dismiss properly".

the main idea is:

to dismiss popover manually, you'll need keep reference it. place in view controller shows popover.

to have button inside content view controller tell original view controller (that presented popover) dismiss popover, 2 of possible ways delegate+protocol or nsnotificationcenter.


in previous answer, presenterviewcontroller root view controller (the 1 presents popover).

the difference in case in contentfooviewcontrollerdone method (which put in root view controller):

- (void)contentfooviewcontrollerdone:(nsnotification *)notification {     // button in content view controller tapped, dismiss popover...     [self.popovercontroller dismisspopoveranimated:yes];      // load new view here...     // note: if intending use presentmodalviewcontroller      // (instead of addsubview), might need set animated no     // above popover dismissal (otherwise presentmodal nothing)      // or use performselector:withobject:afterdelay present new      // view controller animate both dismiss , present. } 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -