Skip to content

Commit

Permalink
Load view controller manually from app delegate.
Browse files Browse the repository at this point in the history
Also update main.m to match the latest auto-generated main.m files
(mostly so that the App Delegate actually gets loaded, since we're no
longer launching with a Main Interface xib)
  • Loading branch information
R. Kevin Nelson committed Jun 20, 2013
1 parent ec2f07d commit fb69df9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
11 changes: 6 additions & 5 deletions Classes/HelloAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ + (Rdio *)rdioInstance
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
launchedDelegate = self;

rdio = [[Rdio alloc] initWithConsumerKey:CONSUMER_KEY andSecret:CONSUMER_SECRET delegate:viewController];
[[rdio player] setDelegate:viewController];

// Add the view controller's view to the window and display.
[self.window addSubview:viewController.view];
rdio = [[Rdio alloc] initWithConsumerKey:CONSUMER_KEY andSecret:CONSUMER_SECRET delegate:nil];

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.viewController = [[HelloViewController alloc] init];

self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

return YES;
Expand Down
15 changes: 8 additions & 7 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#import <UIKit/UIKit.h>

int main(int argc, char *argv[]) {

NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
#import "HelloAppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([HelloAppDelegate class]));
}
}

0 comments on commit fb69df9

Please sign in to comment.