diff options
Diffstat (limited to 'iPhone/FixMyStreet/Classes')
-rw-r--r-- | iPhone/FixMyStreet/Classes/AppDelegate.m | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/iPhone/FixMyStreet/Classes/AppDelegate.m b/iPhone/FixMyStreet/Classes/AppDelegate.m index 77e991d..08c68ef 100644 --- a/iPhone/FixMyStreet/Classes/AppDelegate.m +++ b/iPhone/FixMyStreet/Classes/AppDelegate.m @@ -19,7 +19,7 @@ // // AppDelegate.m -// tmp_ios +// sample // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. @@ -45,7 +45,11 @@ int cacheSizeMemory = 8 * 1024 * 1024; // 8MB int cacheSizeDisk = 32 * 1024 * 1024; // 32MB - NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; +#if __has_feature(objc_arc) + NSURLCache* sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"]; +#else + NSURLCache* sharedCache = [[[NSURLCache alloc] initWithMemoryCapacity:cacheSizeMemory diskCapacity:cacheSizeDisk diskPath:@"nsurlcache"] autorelease]; +#endif [NSURLCache setSharedURLCache:sharedCache]; self = [super init]; @@ -61,10 +65,18 @@ { CGRect screenBounds = [[UIScreen mainScreen] bounds]; - self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease]; +#if __has_feature(objc_arc) + self.window = [[UIWindow alloc] initWithFrame:screenBounds]; +#else + self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease]; +#endif self.window.autoresizesSubviews = YES; - self.viewController = [[[MainViewController alloc] init] autorelease]; +#if __has_feature(objc_arc) + self.viewController = [[MainViewController alloc] init]; +#else + self.viewController = [[[MainViewController alloc] init] autorelease]; +#endif self.viewController.useSplashScreen = YES; // Set your app's start page by setting the <content src='foo.html' /> tag in config.xml. @@ -81,7 +93,7 @@ } // this happens while we are running ( in the background, or from within our own app ) -// only valid if tmp_ios-Info.plist specifies a protocol to handle +// only valid if sample-Info.plist specifies a protocol to handle - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url { if (!url) { @@ -99,8 +111,8 @@ } // repost the localnotification using the default NSNotificationCenter so multiple plugins may respond -- (void) application:(UIApplication*)application - didReceiveLocalNotification:(UILocalNotification*)notification +- (void) application:(UIApplication*)application + didReceiveLocalNotification:(UILocalNotification*)notification { // re-post ( broadcast ) [[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification]; |