iOS | How To Create a SplitViewController iPad Application using a Storyboard

Figure 1 : SplitViewController
Figure 1 : SplitViewController

The SplitViewController is a specialized view controller in the iOS SDK to arrange content in a classic menu and content structure as in figure 1. When an item is selected in the UITableView, the corresponding content is displayed in the Detail View Controller. This tutorial will walk you through the steps to create a basic SplitViewController application.

The premise of the application is to list a selection of evergreen trees in the list menu on the left hand side and when a selection is made the corresponding details of the tree is displayed in the content pane on the right side.

Create the Project


  • First create either an Empty application or a Single View application.
  • Name the app something you like.
  • Add the storyboard option.
  • Select the iPad option since this is the only option for creating split view applications.


Create the Data Model

  • Create a Custom Class as a subclass of the NSObject class once the basic project is created
  • Name the class Trees
  • In the header file define three NSString instance variables: treeName, treeDescription and treePhoto as in code listing 1 below.

Figure 2 - Basic SplitViewController Layout
Figure 2 - Basic SplitViewController Layout

code Listing 1 : Trees Data Model

@interface Trees : NSObject

@property(nonatomic, strong)NSString * treeName;
@property(nonatomic, strong)UIImage * treePhoto;
@property(nonatomic, strong)NSString * treeDescription;

@end

In the implementation file simply synthesize the three variables as shown in code listing 2. 
#import "Trees.h"

@implementation Trees
@synthesize treeName, treePhoto, treeDescription;
@end

Nothing else needs to be done here. In the next parts we will setup the data source and add it to the UITableView which will be the menu data structure.

Setup the Storyboard


Depending on the type of project template, if the Single View was chosen, open the storyboard and delete the view controller, otherwise from the open IB (Inteface Builder) drag a UISplitViewController onto the canvas. As you can see from figure 2 below, the complete UI structure is provided for you. The default layout is Portrait, but if you select the Landscape layout from the Orientation attribute in the Attributes inspector the layout will change to display the Split View Controller with the Master View and Detail controller.

Figure 2 : The SplitViewController Basic Layout
Figure 2 : The SplitViewController Basic Layout

The Split View Controller contains two sections; the Master View on the left and the detail view on the right. You also get an UITableView and UINavigationContoller and corresponding segue which will be displayed in the Master View Controller and another UIViewController with its own segue will be embedded in the Detail View Controller.

In the portrait mode, the Master View Controller is displayed as a UIPopover and is accessible from a button in the Navigator bar. In the landscape mode, the Master View Controller and Detail View Controller is laid out side by side.

We will leave the layout in the landscape mode. When the app will run in the iOS Simulator, it will start in portrait mode. To display in landscape mode simply select rotate right from the Hardware menu.

Also if the Detail View Controller doesn’t have a Navigation View Controller then select it add a navigation view controller by select the “Editor menu” , “Embed” and “Navigation Controller”.

Setup the AppDelegate


The first place to start when creating a Split View Controller application is the AppDelegate’s didFinishLaunchingWithOptions method. Define the UISplitViewController object as the rootViewController and secondly create the navigation controller by assigning the last object in the viewControllers array. Finally the splitViewController’s delegate is set to the navigationController topViewController. The code for the method is provided below in code listing 2.

Code Listing 2 : The didFinishLaunchingWithOptions Implementation

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
    UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
    splitViewController.delegate = (id)navigationController.topViewController;
    
    return YES;
}

These configurations will be globally visible to different parts and objects in application.

Setup the Main View Controller

The main view controller manages the interaction between the master and detail view controllers. It is in this view controller where the data source is configured for the Master View Controller, and it is attached to the Table View Controller in the IB. In fact the Split View Controller has no custom class associated with it.

  • Begin by creating a new custom class as a subclass of the UITableViewController.
  • Name it MasterViewController or some other meaningful name. Make sure to select the “Targeted for iPad”.
  • Next add the custom class to the custom Class field in the Storyboard for TableViewController.
  • In the header file, add an import directive for the Trees data model and the klviewController, which is serve as the custom class for the Detail View Controller. This view controller class was created when the project was created but it will have to added to the Detail View Controller in the storyboard in the next section.
  • Also add a @class directive, which returns a reference to the receiver class
  • Also add the UITableViewDelegate to be able to access the protocol methods that will respond to the user events.
  • To able to access the Detail View Controller’s define a klVDetailViewController instance variable.
  • Next define a NSMutableArray instance variable. This variable will store the items in the menu that will be displayed in the Table View.
  • To be able to push the details of the selected item in the table view controller an id, detailObject, instance variable will be added next. The id is a weakly typed object that can represent an object of any type or when the type is unknown.
  • You will need to add it to the Table View Controller in the Storyboard by selecting the name of the UITableViewController from the drop down custom class field in the Identity inspector in the IB, in this example it is klMasterViewController.
  • The complete code is in listing 3 provided below.

Code Listing 3 : The klMasterController

#import <UIKit/UIKit.h>
#import "Trees.h"
#import "klViewController.h"


@class klViewController;

@interface klMasterController : UITableViewController<UITableViewDelegate>

@property (strong, nonatomic) klViewController *detailViewController;

@property(nonatomic, strong)id detailObject;

-(NSArray *)LoadMenuItems;

@end
  • Start the class implementation by synthesizing the variables that were created in the header.
  • Next add the awakeFromNib method. This method when the UI object is loaded from the IB. In the method add clearsSelectionOnViewWillAppear property of the Table View Controller. Setting this propetty to YES will deselect any items that are selected in the Table View Controller.
  • Then set the size of the Popover to 320.0 x 600.0, when in portrait mode, of the menu using the CGSizeMake method.
The code for the method in code listing 4.

Code Listing 4 : awakeFomeNib Implementation

- (void)awakeFromNib
{
    self.clearsSelectionOnViewWillAppear = YES;
    self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
    [super awakeFromNib];
}

he next method that requires modification is the viewDidLoad which is called the first time the view controller is loaded onto the stack.

  • In the method set the detailViewController to the last item in the array, which is the detail view controller. The code for the viewDidLoad is provided below in code listing 5.

Code Listing 5 : viewDidLoad Implementation

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.detailViewController = (klViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
    
}

Two requisite methods that must be configured when using the UITableViewController are: numberOfSectionsInTableView and numberOfRowsInSection. The first method defines how many items will appear in each row. For this example the return value is 1. The second defines the number of items that will be listed in the table. Typically this is set to the number of items in the data source using the count property. Listing 6 below shows the code for each method implementation.

Code Listing 6 : UITableView Required Methods

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    // Return the number of rows in the section.
        return [self.LoadMenuItems count];
}

The data source is built using the LoadMenuItems method. This method returns a NSArray which will be used to populate the Table View Controller. To build the data source start by creating a NSMutableArray. I am using the NSMutableArray because I can dynamically add items to the array using the addObject method.

Set the initWithCapacity to 5 items for each instance of the Tree objects that will define the data for our data source.

Next create a Trees object call tree and add the information as listed below in code listing 7. I am using information from Wikipedia including the images which are stored in in an images group in the project navigator but you can replace this information by using any other information to suit your purposes as long as you maintain the same structure of defining an object and assigning it to the NSMutableArray.

Add the object to the nSMutableArray.

Code Listing 7 : The Data Source Content

-(NSArray *)LoadMenuItems
{

    NSMutableArray * menuData =  [[NSMutableArray alloc] initWithCapacity:5];
    Trees * tree = [[Trees alloc] init];
    
    tree.treeName = @"Oak";
    tree.treeDescription = @"An oak is a tree or shrub oak tree, of which about 600 species exist. The Oak is native to the northern hemisphere, and includes deciduous and evergreen species extending from cool temperate to tropical latitudes in Asia and the Americas.";
    NSString * file = [[NSBundle mainBundle] pathForResource:@"oak" ofType:@"jpg"];
    tree.treePhoto = [UIImage imageWithContentsOfFile:file];  
    
    [menuData addObject:tree];
    tree=nil;
    
    tree = [[Trees alloc] init];
    tree.treeName = @"Douglas Fir";
    tree.treeDescription = @"Douglas-firs are medium-size to extremely large evergreen trees, 20â120 metres (70â390 ft) tall (although only Coast Douglas-firs reach such great height). The leaves are flat, soft, linear. They completely encircle the branches, which can be useful in recognizing the species. The female cones are pendulous, with persistent scales (unlike true firs), and are distinctive in having a long tridentine (three-pointed) bract that protrudes prominently above each scale (it resembles the back half of a mouse, with two feet and a tail).";
    file = [[NSBundle mainBundle] pathForResource:@"DouglasFir" ofType:@"jpg"];
    tree.treePhoto = [UIImage imageWithContentsOfFile:file];  
    [menuData addObject:tree];
    tree=nil;
    
    tree = [[Trees alloc] init];
    tree.treeName = @"Sugar Maple";
    tree.treeDescription = @"Sugar Maple is a species of maple native to the hardwood forests of northeastern North America, from Nova Scotia west to southern Ontario, and south to Georgia and Texas.[2] Sugar maple is best known for its bright fall foliage and for being the primary source of maple syrup.";
    file = [[NSBundle mainBundle] pathForResource:@"SugarMaple" ofType:@"jpg"];
    tree.treePhoto = [UIImage imageWithContentsOfFile:file];  
    [menuData addObject:tree];
    tree=nil;
    
    tree = [[Trees alloc] init];
    tree.treeName = @"Red Maple";
    tree.treeDescription = @"Red Maple is one of the most common and widespread deciduous trees of eastern North America. It ranges from the Lake of the Woods on the border between Ontario and Minnesota, east to Newfoundland, south to near Miami, Florida, and southwest to east Texas. Many of its features, especially its leaves, are quite variable in form. At maturity it often attains a height of around 15 m (50 ft). It is aptly named as its flowers, petioles, twigs and seeds are all red to varying degrees. Among these features, however, it is best known for its brilliant deep scarlet foliage in autumn.";
    file = [[NSBundle mainBundle] pathForResource:@"RedMaple" ofType:@"jpg"];
    tree.treePhoto = [UIImage imageWithContentsOfFile:file];  
    [menuData addObject:tree];
    tree=nil;
    
    tree = [[Trees alloc] init];
    tree.treeName = @"Pine";
    tree.treeDescription = @"Pines are trees in the genus Pinus. They make up the monotypic subfamily Pinoideae. There are about 115 species of pine, although different authorities accept between 105 and 125 species.";
    file = [[NSBundle mainBundle] pathForResource:@"Pine" ofType:@"jpg"];
    tree.treePhoto = [UIImage imageWithContentsOfFile:file];  
    [menuData addObject:tree];
    menuItems = [[NSArray alloc] initWithArray:(NSArray *)menuData];
    tree=nil;
    
    return menuItems;
    
    
}

The next part of the setup will involved adding code to the - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method. This method configures the data that will appear in each cell of the UITableView. It will be called as many times as there is items in the array as defined in the tableView:numberOfRowsInSection method above. The code for the method is in the following listing 8.

Most of the code in the method is supplied by the SDK when you create the custom UITableViewController subclass. What must be changed is the value of the cellIdentifier. This must match the name of the cell prototype in the IB Storyboard.

To add the data to the table, create a new Trees object, like myTree and assign the object in the array using the objectAtIndex and indexPath.row. The indexPath.row returns the row number.
Finally add the value of the treeName to the cell textLabel property.

Code Listing 8 : The Data Source Configuration

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"menuSelection";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    
    
    Trees * myTree = [self.LoadMenuItems objectAtIndex:indexPath.row];
    cell.textLabel.text = myTree.treeName;
    
    return cell;
}

One more method that we need to discuss is the - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath. This method is provided by the UITableViewDelegate protocol. It will be called when a user clicks on an item in the table view that is serving as the menu for the application. See listing 9.

In the body of the method we get a handle on the object that is selected and the number of the item in the array.

We will assign the object to the detailObject, which is the id variable, which in turn will be passed to the detailViewController’s setDetailItem method that we will look at in the next section.

Code Listing 9 : The didSelectRowAtIndexPath

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    Trees * selectedTree =(Trees *)[self.menuItems objectAtIndex:[self.tableView indexPathForSelectedRow].row];  
    
    
    detailObject = selectedTree;
    
    [detailViewController setDetailItem:detailObject];
    
    
}

Setup the Detail View Controller



The Detail View Controller is the last piece of the puzzle that we will need to implement. If you opted for a Single view application when you created the project, you should have a view controller in the Navigator that can be reused with the Detail View Controller. All you need to do is add the custom view controller to the custom class field in the Identity inspector. If you opted for the empty project in the first step, you will need to create a new custom class as a subclass of the UIViewController. If you have Xcode 5.1, you will need to select the Objective-C category in the new file action sheet to create a new custom class as a subclass of the UIViewController.

The Storyboard version of the Detail View Controller should look like in figure 3. All we need is an UITextView and an UIImageView.

Figure 3 : the Detail View Controller in IB
Figure 3 : the Detail View Controller in IB

Once these are added to the Storyboard, create IBOutlets for them by dragging connections to the header file through the Assistant editor. If you need help with this, check out my tutorial on creating IBOutlets and IBActions.

You can also change the background by selecting the UIView and selecting another background color from the the Attributes inspector.

In the header file of the View Controller custom class start by defining an id variable called detailItem. We will use this to get the information from the selected object. See the code listing below to the complete details of the header file.

Also create an instance of the UIPopoverController, masterPopoverController, which will be used as the menu when the iPad is in Portrait mode.

Next add a method called configureView which will be called to display the contents of the selected object in the UITextView and UIImageView.

The last two objects are the IBOutlets that were previously created. To complete the implementation, open the implementation file and synthesize the declared variables.

Code Listing 9 : The Detail View Controller Header

#import <UIKit/UIKit.h>
#import "Trees.h"

@class Trees;
@interface klViewController : UIViewController
@property (strong, nonatomic) id detailItem;
@property (strong, nonatomic) UIPopoverController *masterPopoverController;
- (void)configureView;
@property (retain, nonatomic) IBOutlet UITextView *detailDescription;

@property (retain, nonatomic) IBOutlet UIImageView *detailImage;

@end

In the implementation file once the synthesization is complete, define the setDetailItem property method of the detailItem variable, see the code in listing 10. In the body of the method first check to see if the object passed by parameter newDetailItem is the same as the current object detailItem. If it isn’t call the configureView to display the new selected item. Also if the app is in the Portrait mode and the popover menu is displayed to dismiss it after the selection is made and the new object is displayed.

The next important method is the configureView which will assign the id object detailItem to an actual Trees object so that we can access its properties and display the details in the appropriate IBOutlets.
Finally the viewdidUnload resets the objects to nil so that they can be released with ARC.

Code Listing 10 : The Detail View Controller Implementation

#import "klViewController.h"



@implementation klViewController
@synthesize detailDescription;
@synthesize detailImage;
@synthesize masterPopoverController, detailItem;

- (void)setDetailItem:(id)newDetailItem
{
    if (detailItem != newDetailItem) {
        detailItem = newDetailItem;
        
        // Update the view.
        [self configureView];
    }
    
    //This is for the portrait mode to dismiss the menu after selection
    
    if (self.masterPopoverController != nil) {
        [self.masterPopoverController dismissPopoverAnimated:YES];
    }        
}
- (void)configureView{
    // Update the user interface for the detail item.
    Trees * aTree = (Trees *)self.detailItem;
    
    self.detailDescription.text = aTree.treeDescription;
    self.detailImage.image = aTree.treePhoto;
}

- (void)viewDidUnload
{
    [self setDetailDescription:nil];
    [self setDetailImage:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

Run and Test


All that remains is to compile and run the app.

Figure 4 : The Running App in Landscape Mode
Figure 4 : The Running App in Landscape Mode

More by this Author


Comments 35 comments

Jakub82 4 years ago

Hi, this is Jakub from Czech Republic, you helped me a lot with previous tutorial! Sorry that I am using this "comment" line for asking you again for your help,because it has nothig to do with this tutorial. I don't know how to reach you other way :-(

So if I may ask you... I would really appreciate if you show me how to insert a lot of MKAnnotations into the mapView. For example 200 pins,which data: lat,lon,title and subtitle I'm storing in sqlite. I don't want to write a code for each one separate if you understand me...:-)

Thanks you very much for any help!! I cannot figure it out. Jakub


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Hi Jakub82,

Nice to hear from you. My e-mail is kevinlanguedoc[at]gmail.com :)

I will gladly help out. Give me a couple of days and I will send you the code.

Kevin


Jakub82 4 years ago

Hi Kevin, I'm really looking forward to learn some new bit of code...:-) Thank you for your email. Of course I will waite!! By for now. Jakub


hembreed 4 years ago

I don't see what's wrong here, this code:

UINavigationController *navigationController = (UINavigationController *) [splitViewController.viewControllers lastObject];

splitViewController.delegate = (id)[navigationController topViewController];

gives me this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController topViewController]: unrecognized selector sent to instance 0x6a54650'

As can be seen, the navigationController is cast to the right type, but the error messages says it's a UIViewController. I suspect that is the problem but I don't see what to do about it.


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Yes I had the same problem....

Did you had a navigation controller before the detail view controller because it is not added by default when you drag a split view controller. look at figure 2 or figure 3. This eliminated the problem for this example.


Jakub 4 years ago

Hi Kevin,

I'm really sorry I'm bugging you again! Just don't know if you got my email...I'm looking forward to your code, which enable to put multiple annotations into the MKMapView with data stored in sqlite...just like I said in the comment line earlier in this thread.

Thank you very much for your help! I'm looking forward to hear from you.

Jakub


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Hi Jakub,

I am sorry for not responding, I have sent you an e-mail. I was not sure about your question,

1- do you want to pre load annotation data in a database to be displayed in a map?

2- or is your question about displaying multiple annotations on a map?

3- or do you need code to preload data in a db and display the annotations on a map?

I am currently working on a new app at the moment, but if you can clarify your question, I am more than happy to help you out with the code.

kevin


Jakub82 4 years ago

Hi Kevin,

nice to hear from you. I did not receive your email :-( "kunesek@gmail.com" . So, here is my specifications.

I think it is question number 2. from yours choises. I have my data (latitude, longitude, title and subtitle) already stored in my sqlite database. And also I have the code to load them from that database. (So I have these variables:double lat, double lon, NSString *title and NSString *subtitle with theirs due values). What I want to do is to use that data for displaying multiple annotations on a map. :-) I hope it is clear for you...yeah my english!! :-(

Thanks again!

Jakub


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Hi Jakub,

Your English is excellent. I have started working on the second question, I will send you the code today or tomorrow.

Cheers

Kevin


Jakub82 4 years ago

Looking forward to your code :-)

It is gonna be my first app ever :-) It is my hobby for now, but in the future I would really like to find any job like that, working with apple products and developing useful staf for that wonderful platform.

Have a nice day. Thanks

Jakub


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Totally agree


Reid 4 years ago

I am having some trouble wrapping my hard around implementing the tree and trees class. Is the source code available for this project?


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Hi Reid

Sure, send me an e-mail at kevinlanguedoc@gmail.com and I will gladly send you a copy

Kevin


Shailesh 4 years ago

Hi once again, Im not sure where to declare menuItems. You have used it in the Code Listing 7 :

menuItems = [[NSArray alloc] initWithArray:(NSArray *)menuData];

tree=nil;

return menuItems;

Currently i have declared it as private property in MasterViewController.m file as,

@interface MasterViewController ()

@property (nonatomic, strong)id menuItems;

@end

Correct me if im wrong , also in the portrait mode how to configure a bar button inorder to popover the tableView over DetailView.

Thanks in advance


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

First the bar button is automatic when in portrait mode. It should appear as a bar button without any additional code. As for the menu items, look at code listing 6 as it tells the table how many items are in the array to display and then look at code listing 8. The code in code listing 8 will automatically loop and add the items to the table based on the count in code listing 6.

hope this helps. Please keep me posted


Sonali Saswade 4 years ago

Hi I am not able to see the table view at all


klanguedoc profile image

klanguedoc 4 years ago from Canada Author

Are you getting an error message?


Gavin 3 years ago

Hi great tutorial , It's nicely written and clear. The only problem I'm having is similar to the one above. There is no popover button appearing in portrait mode. Any help with this would be greatly appreciated.

Ps I'm using xCode 4.5.2 and building against 6.0

Thanks for your work


Gavin 3 years ago

It's ok I have figured this out and if any one else has the same issue you can paste this code to the bottom of the DetailViewController .m (just before the @end is fine)

#pragma mark - Split view

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController

{

barButtonItem.title = NSLocalizedString(@"Web Sites", @"Web Sites");

[self.navigationItem setLeftBarButtonItem:barButtonItem animated:YES];

self.masterPopoverController = popoverController;

}

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem

{

// Called when the view is shown again in the split view, invalidating the button and popover controller.

[self.navigationItem setLeftBarButtonItem:nil animated:YES];

self.masterPopoverController = nil;

}


Gav 3 years ago

Sorry just how I implemented to into a project where it says @"Web Sites" you can change that back to @"Master" it's just the title

Hope this helps


klanguedoc profile image

klanguedoc 3 years ago from Canada Author

Thanks for the great feedback and code Gavin


swathi 3 years ago

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem


swathi 3 years ago

- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController

- (void)splitViewController:(UISplitViewController *)splitController willShowViewController:(UIViewController *)viewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem

This two methods are called only when i change Orientation... i want barbutton When i load split view in portrait only in every detail view class. lets think that A and B are 2 classes, at initial app is loaded at A Class, i am able to see barbutton , when i change to B class barbutton is missing and Again come Back to A, bar button is missing in A class also.

how can i overcome this....


klanguedoc profile image

klanguedoc 3 years ago from Canada Author

You will need to check the current orientation and display the barButtonItem when in portrait mode only, if I have understood your issue correctly.


adamkorkp 3 years ago

Hi,

Thanks for putting nice tutorials. I have two quires

1) I am very new to this . I tried to follow your instruction. The only problem is that whenever i select a row , it is not displayed in detail view. I tried debugging and the value for detail item in - (void)configureView is all correct , its not setting the detail properties. I checked the connection in detail view and all looks good to me.

(if you could help me or send me code for it at adamkorkp(at)gmail.com, i would be grateful)

2)What if there are sub menus, how to implement it. Eg: Lets say when you select "oak" from menu then it should show the sub type of oak and when selected those sub type oak displays detail in detailview controller.

thanks a lot


Motte 3 years ago

Hi,

Thanks for this tutorial! I have however an issue:

The detail view is not loaded. It is instead a plain black screen.

Any suggestions?

Thanks in advance!


klanguedoc profile image

klanguedoc 3 years ago from Canada Author

adamkorkp,

check out iosdev101.com/downloads

I put most of my code there

Motte,

I don't understand. When you load the detail view, it is blank?


dan boghiu 3 years ago

Great Man, the tutorial helped me a lot.


klanguedoc profile image

klanguedoc 3 years ago from Canada Author

Cool. thanks


Techd 3 years ago from argyle, tx

I really like the tutorials you make. The question I have is how would i put a split view as one of the tabs of a tabview controller and have it talk to a josn feed and not have it freak out?


klanguedoc profile image

klanguedoc 3 years ago from Canada Author

I never tried that but it should work ok if you link up the view controller correctly


Ramesh 2 years ago

Hi kevin,

I am trying one requirement. I have been trying this since last two days. But not yet find a solution. I read lots more posts. But that are not clear.

My requirement is,

Login Viewcontroller presents splitviewcontroller

Is it possible to implement?

Thanks in advance.


klanguedoc profile image

klanguedoc 2 years ago from Canada Author

Instead of calling a splitcontroller after a login, overlay a login using the UIAlert object for example.


TTGReviews profile image

TTGReviews 22 months ago

Is there a way to get the iOS SDK on a Windows computer.


klanguedoc profile image

klanguedoc 22 months ago from Canada Author

yes you need to use Xamarin with Visual studio

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working