Skip to content

Commit 6299b22

Browse files
committed
Fix breakage in Twitter example running under iOS 5.x. fixes RestKit#1077
1 parent 5f589ba commit 6299b22

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Examples/RKTwitter/Classes/RKTwitterAppDelegate.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,5 @@
88

99
#import <UIKit/UIKit.h>
1010

11-
12-
@interface RKTwitterAppDelegate : NSObject <UIApplicationDelegate> {
13-
}
14-
11+
@interface RKTwitterAppDelegate : UIResponder <UIApplicationDelegate>
1512
@end
16-

Examples/RKTwitter/Classes/RKTwitterAppDelegate.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
@implementation RKTwitterAppDelegate
1616

17+
@synthesize window;
18+
1719
#pragma mark -
1820
#pragma mark Application lifecycle
1921

@@ -33,7 +35,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3335

3436
// Initialize RestKit
3537
RKObjectManager *objectManager = [[RKObjectManager alloc] initWithHTTPClient:client];
36-
3738

3839
// Setup our object mappings
3940
RKObjectMapping *userMapping = [RKObjectMapping mappingForClass:[RKTUser class]];
@@ -71,13 +72,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
7172
// Create Window and View Controllers
7273
RKTwitterViewController *viewController = [[RKTwitterViewController alloc] initWithNibName:nil bundle:nil];
7374
UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:viewController];
74-
UIWindow *window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
75-
[window addSubview:controller.view];
76-
[window makeKeyAndVisible];
75+
self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
76+
self.window.rootViewController = controller;
77+
[self.window makeKeyAndVisible];
7778

7879
return YES;
7980
}
8081

81-
82-
8382
@end

0 commit comments

Comments
 (0)