Nerrolken
Nerrolken

Reputation: 1995

URLForUbiquityContainerIdentifier was working fine, now returns nil

I've got one of the simplest methods I can write:

+(NSURL *)notesURL {
    NSURL *url = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
    return [url URLByAppendingPathComponent:kAllNotes];
}

And it was working great. I developed a whole app, submitted it, got approved, the works.

Then I tried to make a new app with a similar method, but URLForUbiquityContainerIdentifier kept returning nil. Research on Stack Overflow has revealed that that means that iCloud isn't accessible. Thing is, I've got my entitlements set up, iCloud is enabled in my XCode project, my ubiquity container is set up with my Bundle ID, my provisioning profile includes iCloud usage, and for what it's worth all the iCloud services on my computer at large are working well.

On a lark I went back and tried to run my last app in the simulator, and that doesn't work either, even though it used to work perfectly. An NSLog in the middle of the above method is printing (null) for the variable "url".

I can't think of anything that has changed between then and now, except for upgrading to the OS X Mavericks preview, but I've got a Mountain Lion partition on my computer and these symptoms are happening on that side as well.

Any idea what this could be?

Upvotes: 1

Views: 821

Answers (1)

Rob Glassey
Rob Glassey

Reputation: 2257

Have you tried running on device? On Mountain Lion and XCode 4 iCloud is NOT supported in the simulator. If that doesn't work, it's something in your entitlements that's screwed up, and that just means going through the oodles of questions on here about that already.

Upvotes: 1

Related Questions