PageRenderTime 23ms CodeModel.GetById 9ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/Mobile/iPhone/StoffiRemote/StoffiRemote/StoffiRemoteAppDelegate.m

http://yet-another-music-application.googlecode.com/
Objective C | 95 lines | 47 code | 19 blank | 29 comment | 0 complexity | 34a555cbc7c3e3f514594c14e01080ad MD5 | raw file
 1//
 2//  StoffiRemoteAppDelegate.m
 3//  StoffiRemote
 4//
 5//  Created by Fredrik Gadnell on 9/11/11.
 6//  Copyright 2011 __MyCompanyName__. All rights reserved.
 7//
 8
 9#import "StoffiRemoteAppDelegate.h"
10#import "GaddREST.h"
11#import "StoffiOAuthManager.h"
12#import "RemoteViewController.h"
13#import "User.h"
14
15
16@implementation StoffiRemoteAppDelegate
17
18
19@synthesize window=_window;
20
21- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
22{
23    // Override point for customization after application launch.
24    [self.window makeKeyAndVisible];
25    
26    // Setup the shared REST client
27    [[RESTClient sharedClient] setBaseURL:@"http://alpha.stoffiplayer.com"];
28    [[RESTClient sharedClient] setShouldSimulateResponse:YES];
29    
30    // Basic navigation setup
31    nav = [[UINavigationController alloc] init];
32    [self.window addSubview:nav.view];
33    RemoteViewController *remoteVC = [[RemoteViewController alloc] init];
34    [nav pushViewController:remoteVC animated:YES];
35    [remoteVC presentLoginScreenAnimated:NO];
36    
37    return YES;
38}
39
40- (void)restRequestDidFail:(RESTRequest *)request {
41    NSLog(@"Did receive callback from RestRequest: Request failed");
42}
43
44- (void)restRequest:(RESTRequest *)request didLoadResult:(id)jsonObject {
45    NSLog(@"Did receive callbak from RestRequest: %@", jsonObject);
46}
47
48- (void)applicationWillResignActive:(UIApplication *)application
49{
50    /*
51     Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
52     Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
53     */
54}
55
56- (void)applicationDidEnterBackground:(UIApplication *)application
57{
58    /*
59     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
60     If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
61     */
62}
63
64- (void)applicationWillEnterForeground:(UIApplication *)application
65{
66    /*
67     Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
68     */
69    
70    [[User currentUser] pullConfiguration];
71}
72
73- (void)applicationDidBecomeActive:(UIApplication *)application
74{
75    /*
76     Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
77     */
78}
79
80- (void)applicationWillTerminate:(UIApplication *)application
81{
82    /*
83     Called when the application is about to terminate.
84     Save data if appropriate.
85     See also applicationDidEnterBackground:.
86     */
87}
88
89- (void)dealloc
90{
91    [_window release];
92    [super dealloc];
93}
94
95@end