Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hi I made it as below it may help you.Just pass parameter as described and you can get slpitview as you desired.</p> <p>.H file </p> <pre><code>#import &lt;Foundation/Foundation.h&gt; @class AppDelegate; @interface CustomSplitView : NSObject { AppDelegate *objAppDelegate; } +(UIView *) setSplitView : (UIViewController *)masterView : (UIViewController*)DetailView :(CGRect)frame; +(void) changeSplitView:(UIViewController *)DetailView :(UINavigationController *)navigationController; @end </code></pre> <p>.M file </p> <pre><code>#import "CustomSplitView.h" #import "AppDelegate.h" @implementation CustomSplitView //*********this return view addsubview on self.view +(UIView *) setSplitView:(UIViewController *)masterView :(UIViewController *)DetailView :(CGRect)frame { objAppDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate] ; objAppDelegate.objMasterView=masterView; objAppDelegate.objDetailView=DetailView; //Select navigation for every split view UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:objAppDelegate.objMasterView] autorelease]; UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:objAppDelegate.objDetailView] autorelease]; ; objAppDelegate.objSplitView.delegate=objAppDelegate; objAppDelegate.objSplitView.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController ,nil]; objAppDelegate.objSplitView.view.frame=frame; return (objAppDelegate.objSplitView.view); } +(void) changeSplitView:(UIViewController *)DetailView :(UINavigationController *)navigationController { objAppDelegate=(AppDelegate *)[[UIApplication sharedApplication] delegate] ; UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:DetailView] autorelease]; objAppDelegate.objDetailView=detailNavigationController ; // Update the split view controller's view controllers array. // NSArray *viewControllers = [[NSArray alloc] initWithObjects:navigationController, objAppDelegate.objDetailView, nil]; // objAppDelegate.objSplitView.viewControllers= viewControllers; objAppDelegate.objSplitView.viewControllers = [NSArray arrayWithObjects:navigationController, objAppDelegate.objDetailView ,nil]; } @end </code></pre> <p>for set split in your home view</p> <pre><code> Masterview *objFirstView = [[Masterview alloc] initWithNibName:@"Masterview" bundle:nil]; appdel.masterDelegate = objFirstView; Detailview *objSecondView = [[Detailview alloc] initWithNibName:@"Detailview" bundle:nil]; UIView *objView=[CustomSplitView setSplitView:objFirstView :objSecondView :self.view.frame]; [self.view addSubview:objView]; [objFirstView release]; [objSecondView release]; </code></pre>
 

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