Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 802
user717452 Avatar asked Apr 10 '15 02:04

user717452


2 Answers

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

like image 82
Paulw11 Avatar answered Sep 26 '22 23:09

Paulw11


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

like image 31
sam_smith Avatar answered Sep 22 '22 23:09

sam_smith