drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

Deprecated method in CDEICloudFileSystem.m: #172

Closed Spokane-Dude closed 10 years ago

Spokane-Dude commented 10 years ago

Hi Drew... FYI, in v 1.2, I'm getting this warning when building iOS app...

Ensembles/Framework/Source/Cloud File Systems/CDEICloudFileSystem.m:307:68: 'NSMetadataUbiquitousItemIsDownloadedKey' is deprecated: first deprecated in iOS 7.0 - Use NSMetadataUbiquitousItemDownloadingStatusKey instead

I fixed it in my code, just thought you might want to fix it in GitHub.

drewmccormack commented 10 years ago

This code is currently ifdef-ed. If you are deploying on 6.0 or earlier, it should use the deprecated API, otherwise the new API.

Spokane-Dude commented 10 years ago

I don't see the #ifdef in the code in the Master branch... if I do a 'pod update', I assumed it would get the latest branch from GitHub... since it isn't in my updated code, I went ahead and changed line 305 to:

         NSNumber *downloaded = [metadataQuery 

valueOfAttribute:NSMetadataUbiquitousItemDownloadingStatusKey forResultAtIndex:i];

which I'm hoping is correct.

Drew McCormack mailto:notifications@github.com August 1, 2014 at 9:41 AM

This code is currently ifdef-ed. If you are deploying on 6.0 or earlier, it should use the deprecated API, otherwise the new API.

— Reply to this email directly or view it on GitHub https://github.com/drewmccormack/ensembles/issues/172#issuecomment-50906698.

donald-pinckney commented 10 years ago

I would confirm that the code is not #ifdef-ed for me either, as of version 1.2.1

drewmccormack commented 10 years ago

The #if is on line 250 here: https://github.com/drewmccormack/ensembles/blob/master/Framework/Source/Cloud%20File%20Systems/CDEICloudFileSystem.m

luke0x commented 10 years ago

@drewmccormack Correct, but there is second call of NSMetadataUbiquitousItemIsDownloadedKey in initiateDownloads, which is not #ifdef-ed:

https://github.com/drewmccormack/ensembles/blob/master/Framework/Source/Cloud%20File%20Systems/CDEICloudFileSystem.m#L314

drewmccormack commented 10 years ago

Ah, OK, I see now. Will fix.

Drew

On Aug 19, 2014, at 15:33, Luke Crawford notifications@github.com wrote:

@drewmccormack Correct, but there is second call of NSMetadataUbiquitousItemIsDownloadedKey in initiateDownloads, which is not #ifdef-ed:

https://github.com/drewmccormack/ensembles/blob/master/Framework/Source/Cloud%20File%20Systems/CDEICloudFileSystem.m#L314

— Reply to this email directly or view it on GitHub.

drewmccormack commented 10 years ago

OK, master now has the fix.

drewmccormack commented 10 years ago

By the way, your code above is not quite correct. NSMetadataUbiquitousItemDownloadingStatusKey gives a string, and you have to compare that string to 3 constants. See new code.