I'm getting compiler warnings with AFNetworking, but shouldn't be. How do I fix it?

后端 未结 3 1343
栀梦
栀梦 2020-12-14 00:50

I\'m using the most excellent AFNetworking library in a project that I\'m currently upgrading to iOS 6. I\'m in the middle of the upgrade, whittling down the bu

3条回答
  •  [愿得一人]
    2020-12-14 01:31

    If you're using swift: Xcode compiles Swift code before the Prefix.pch file is compiled, so you'll get these warnings even if the correct imports are in your .pch file. The best solution I've found is to add them to the project's Bridging-Header.h file before importing AFNetworking:

    #import 
    #import 
    #import "AFNetworking.h"
    

提交回复
热议问题