From 6299b22cc43a842379abf4db464f0234c10d6adc Mon Sep 17 00:00:00 2001 From: Blake Watters Date: Fri, 14 Dec 2012 18:22:28 -0500 Subject: [PATCH] Fix breakage in Twitter example running under iOS 5.x. fixes #1077 --- Examples/RKTwitter/Classes/RKTwitterAppDelegate.h | 6 +----- Examples/RKTwitter/Classes/RKTwitterAppDelegate.m | 11 +++++------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Examples/RKTwitter/Classes/RKTwitterAppDelegate.h b/Examples/RKTwitter/Classes/RKTwitterAppDelegate.h index 2afba3adf4..a35708b660 100644 --- a/Examples/RKTwitter/Classes/RKTwitterAppDelegate.h +++ b/Examples/RKTwitter/Classes/RKTwitterAppDelegate.h @@ -8,9 +8,5 @@ #import - -@interface RKTwitterAppDelegate : NSObject { -} - +@interface RKTwitterAppDelegate : UIResponder @end - diff --git a/Examples/RKTwitter/Classes/RKTwitterAppDelegate.m b/Examples/RKTwitter/Classes/RKTwitterAppDelegate.m index 642d65a742..4814764011 100644 --- a/Examples/RKTwitter/Classes/RKTwitterAppDelegate.m +++ b/Examples/RKTwitter/Classes/RKTwitterAppDelegate.m @@ -14,6 +14,8 @@ @implementation RKTwitterAppDelegate +@synthesize window; + #pragma mark - #pragma mark Application lifecycle @@ -33,7 +35,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Initialize RestKit RKObjectManager *objectManager = [[RKObjectManager alloc] initWithHTTPClient:client]; - // Setup our object mappings RKObjectMapping *userMapping = [RKObjectMapping mappingForClass:[RKTUser class]]; @@ -71,13 +72,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Create Window and View Controllers RKTwitterViewController *viewController = [[RKTwitterViewController alloc] initWithNibName:nil bundle:nil]; UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:viewController]; - UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; - [window addSubview:controller.view]; - [window makeKeyAndVisible]; + self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; + self.window.rootViewController = controller; + [self.window makeKeyAndVisible]; return YES; } - - @end