Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created January 2, 2014 05:27
Show Gist options
  • Select an option

  • Save keicoder/8215393 to your computer and use it in GitHub Desktop.

Select an option

Save keicoder/8215393 to your computer and use it in GitHub Desktop.
objective-c : iCloud Setup on AppDelegate
iCloud Setup on AppDelegate
- (void)setupiCloud
{
dispatch_queue_t background_queue =
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
0);
dispatch_async(background_queue, ^{
NSFileManager *fileManager =
[NSFileManager defaultManager];
NSURL *iCloudURL =
[fileManager URLForUbiquityContainerIdentifier:nil];
if (iCloudURL != nil) {
NSLog(@"iCloud URL is available");
}
else
{
NSLog(@"iCloud URL is NOT available");
}
});
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupiCloud];
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment