Permalink
Browse files

Merge branch 'ios6'

  • Loading branch information...
2 parents 4cb17e4 + 9b8304e commit 3f14b54172e7ccfac405f8f2d110ea92f08b85e5 @timd committed Mar 12, 2013
View
2 Chapter11/SplitViewApp/SplitViewApp/LeftTableViewController.m
@@ -166,4 +166,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
+
+
@end
View
4 Chapter11/SplitViewApp/SplitViewApp/RightDetailViewController.m
@@ -10,8 +10,6 @@
@implementation RightDetailViewController
-@synthesize statusLabel = _statusLabel;
-
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
@@ -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];
}
View
2 Chapter11/SplitViewApp/SplitViewApp/SVAppDelegate.h
@@ -8,6 +8,8 @@
#import <UIKit/UIKit.h>
+@class SplitViewController;
+
@interface SVAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
View
17 Chapter11/SplitViewApp/SplitViewApp/SVAppDelegate.m
@@ -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]];
@@ -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;
View
4 Chapter11/SplitViewApp/SplitViewApp/SplitViewApp-Info.plist
@@ -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.