Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I finally found a way. I probably found the error. What i have done is cutting the branch on which i am sitting. I was releasing the view controller which i am currently in:) When viewdidDisappear called, there is no such view controller. Because i throw away it to space already.Below is my working steps. I hope it will be useful to someone. But i cant stand thinking of apple may reject my app. I wish finding a suitable way. </p> <p><strong>This is my working ultimate way of using split view controller and navigation controller as window root view controller alternately.</strong></p> <p>Firstly i defined NavigationController and SplitViewController property in AppDelegate interface.</p> <pre><code>AppDelegate.h @property (assign,nonatomic) UINavigationController * NC; @property (assign,nonatomic) UISplitViewController *SVC; </code></pre> <p>Secondly i assign newly created NC on AppDelegate didFinishLaunch event.</p> <pre><code>AppDelegate.m //Creating my main screen controller //Creating my navigation controller with my view controller instance. Then self.NC= my_navigation_controller; self.window.rootViewController= self.NC; </code></pre> <p>Thirdly creating a splitview controller and setting as app's root view controller</p> <pre><code> MyMainScreen.m -(void) OpenSplit() { //Creating my master view controller of SVC //Creating my detail view controller of SVC //Creating my SVC; AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate]; app_delegate.SVC= newly created my SVC; app_delegate.window.rootViewController= app_delegate.SVC; } </code></pre> <p>Fourthly releasing unused NC in viewDidLoad event of detail view of SVC.</p> <pre><code>MyDetailView.m - (void) viewDidLoad() { ... AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate]; app_delegate.NC= nil; //i dont need it now. i am releasing. Releasing Navigation Controller release as well child controllers. I learned with testing. } </code></pre> <p>Fifthly managing close split view function.I used UIBarButton on NavigationBar in DetailView.</p> <pre><code>MyDetailView.m -(void) closeSplitView { //Creating navigation controller with my main screen view controller AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate]; app_delegate.NC= newly_created_NC; app_delegate.window.rootViewController= appdelegate.NC; } </code></pre> <p>Sixthly handling unused split view controller in Main Screen viewDidLoad event.</p> <pre><code> MyMainScreen.m -(void) viewDidLoad { AppDelegate * app_delegate= [[UIApplication sharedApplication] delegate]; app_delegate.SVC= nil; //I am releasing it because i am working with NC now. } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload