简体   繁体   中英

Nullability issue on Xcode 6.3

I upgraded to Xcode 6.3 yesterday. Since then, I have been unable to build anything that has Parse.framework in it. For PFConstants.h I get errors like

nullability specifier '_nullable' cannot be applied to non-pointer

I have never seen this error before, and changed nothing other than updating to 6.3. Any ideas?

Parse has implemented the new nullability annotations that are available in Xcode 6.3 - See their blog post , but it seems the approach in their old framework causes these compilation errors.

Simply update the Parse frameworks from the latest API downloads and you will be back in business

This seems to be an issue with the version of Parse you are using. Although an obvious answer is to update your versions of Parse this can cause knock on effects in the app.

I didn't want to update to the latest version of Parse as this would require significant changes to adapt to the new Facebook SDK and other needed libraries.

I found that this fix worked well for getting the project compiling and working:

Switch around the location of PF_NULLABLE_S in the problem variables and it seemed to fix the issue

So switch this:

typedef void (^PFArrayResultBlock)(PF_NULLABLE_S NSArray *objects, PF_NULLABLE_S NSError *error);

to this:

typedef void (^PFArrayResultBlock)(NSArray * PF_NULLABLE_S objects, NSError * PF_NULLABLE_S error);

This enabled my apps to compile and run as normal without changing the libraries. This answer is certainly not a fix to the underlying issue but is very useful in many situations eg. you want to be able test an older version, don't want to update it yet but still want to be able to run it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM