上啓用這是我的代碼:無法確定是否icloud是我的設備
- (IBAction)aBackupSetup:(UIButton *)sender {
// check to see if this device is iCloud enabled; display message if not
NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
if (ubiq) {
NSLog(@"AppDelegate: iCloud access!");
} else {
NSLog(@"AppDelegate: No iCloud access (either you are using simulator or, if you are on your phone, you should check settings");
}
我試圖確定是否是iCloud的設備(新iPad)上啓用。當我通過在應用程序中點擊UIButton來運行此代碼時,它會記錄「No iCloud access ...」。我已經看到這個代碼遍及SO和互聯網 - 爲什麼它不能在我的設備上工作? (在iPad上啓用iCloud IS)。
那麼,是否啓用了iCloud?你沒有提到這一點。 –
糟糕...是的,它在iPad上啓用。 – SpokaneDude
是設置> iCloud中的「文檔和數據」開關? –