Skip to content

Commit

Permalink
Merge branch 'ios6'
Browse files Browse the repository at this point in the history
  • Loading branch information
timd committed Mar 12, 2013
2 parents 4cb17e4 + 9b8304e commit 3f14b54
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Chapter11/SplitViewApp/SplitViewApp/LeftTableViewController.m
Expand Up @@ -166,4 +166,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

}



@end
Expand Up @@ -10,8 +10,6 @@

@implementation RightDetailViewController

@synthesize statusLabel = _statusLabel;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
Expand Down Expand Up @@ -78,7 +76,7 @@ -(void)updateDetailViewWith:(NSString *)detail {

NSLog(@"updateDetailViewWith:%@ called", detail);

_statusLabel.text = [NSString stringWithFormat:@"%@ was selected", detail];
self.statusLabel.text = [NSString stringWithFormat:@"%@ was selected", detail];

}

Expand Down
2 changes: 2 additions & 0 deletions Chapter11/SplitViewApp/SplitViewApp/SVAppDelegate.h
Expand Up @@ -8,6 +8,8 @@

#import <UIKit/UIKit.h>

@class SplitViewController;

@interface SVAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
Expand Down
17 changes: 9 additions & 8 deletions Chapter11/SplitViewApp/SplitViewApp/SVAppDelegate.m
Expand Up @@ -13,9 +13,6 @@

@implementation SVAppDelegate

@synthesize window = _window;
@synthesize splitViewController = _splitViewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
Expand All @@ -33,15 +30,19 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
leftTableVC.delegate = rightDetailVC;

// Create split view controller and load its view controllers
_splitViewController = [[UISplitViewController alloc] init];
self.splitViewController = [[UISplitViewController alloc] init];
NSArray *viewControllers = [[NSArray alloc] initWithObjects:leftNavController, rightNavController, nil];

_splitViewController.delegate = rightDetailVC;
_splitViewController.viewControllers = viewControllers;
self.splitViewController.delegate = rightDetailVC;
self.splitViewController.viewControllers = viewControllers;

// Add the split view controller to the view
[self.window addSubview:_splitViewController.view];

// Deprecated in iOS6
//[self.window addSubview:_splitViewController.view];

// For iOS6, add the split view controller as the root view controller
self.window.rootViewController = self.splitViewController;

// Set up the window and return
[self.window makeKeyAndVisible];
return YES;
Expand Down
4 changes: 2 additions & 2 deletions Chapter11/SplitViewApp/SplitViewApp/SplitViewApp-Info.plist
Expand Up @@ -33,9 +33,9 @@
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>

0 comments on commit 3f14b54

Please sign in to comment.