简体   繁体   English

Xcode 6.3上的可空性问题

[英]Nullability issue on Xcode 6.3

I upgraded to Xcode 6.3 yesterday. 我昨天升级到了Xcode 6.3。 Since then, I have been unable to build anything that has Parse.framework in it. 从那以后,我一直无法构建任何具有Parse.framework的东西。 For PFConstants.h I get errors like 对于PFConstants.h,我得到错误

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. 我之前从未见过这个错误,除了更新到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. Parse已经实现了Xcode 6.3中提供的新的可空性注释 - 请参阅他们的博客文章 ,但似乎旧框架中的方法会导致这些编译错误。

Simply update the Parse frameworks from the latest API downloads and you will be back in business 只需从最新的API下载更新Parse框架,您就可以恢复营业了

This seems to be an issue with the version of Parse you are using. 这似乎是您正在使用的Parse版本的问题。 Although an obvious answer is to update your versions of Parse this can cause knock on effects in the app. 虽然一个明显的答案是更新你的Parse版本,这可能会导致应用程序中的连锁效应。

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. 我不想更新到最新版本的Parse,因为这需要进行重大更改以适应新的Facebook SDK和其他所需的库。

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 在问题变量中切换PF_NULLABLE_S的位置,它似乎解决了问题

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 您希望能够测试旧版本,不想更新它但仍希望能够运行它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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