Debian Codegraph @

iOS/Csound iOS Obj-C Examples/Csound iOS Examples/AppDelegate.m

raw
1 /*
2
3 AppDelegate.m:
4
5 Copyright (C) 2011 Steven Yi
6
7 This file is part of Csound iOS Examples.
8
9 The Csound for iOS Library is free software; you can redistribute it
10 and/or modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 Csound is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with Csound; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 02111-1307 USA
23
24 */
25
26 #import "AppDelegate.h"
27
28 #import "MasterViewController.h"
29
30 #import "DetailViewController.h"
31 #import "SimpleTest1ViewController.h"
32
33 @implementation AppDelegate
34
35 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
36 {
37 self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
38 // Override point for customization after application launch.
39 if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
40 MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPhone" bundle:nil];
41 self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
42 self.window.rootViewController = self.navigationController;
43 } else {
44 MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController_iPad" bundle:nil];
45 UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
46
47 SimpleTest1ViewController *detailViewController = [[SimpleTest1ViewController alloc] initWithNibName:@"SimpleTest1ViewController" bundle:nil];
48 UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
49
50 self.splitViewController = [[UISplitViewController alloc] init];
51 self.splitViewController.delegate = detailViewController;
52 self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
53 detailViewController.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem;
54
55 self.window.rootViewController = self.splitViewController;
56 }
57 [self.window makeKeyAndVisible];
58 return YES;
59 }
60
61 - (void)applicationWillResignActive:(UIApplication *)application
62 {
63 /*
64 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.
65 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.
66 */
67 }
68
69 - (void)applicationDidEnterBackground:(UIApplication *)application
70 {
71 /*
72 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.
73 If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
74 */
75 }
76
77 - (void)applicationWillEnterForeground:(UIApplication *)application
78 {
79 /*
80 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.
81 */
82 }
83
84 - (void)applicationDidBecomeActive:(UIApplication *)application
85 {
86 /*
87 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.
88 */
89 }
90
91 - (void)applicationWillTerminate:(UIApplication *)application
92 {
93 /*
94 Called when the application is about to terminate.
95 Save data if appropriate.
96 See also applicationDidEnterBackground:.
97 */
98 }
99
100 @end