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

后端 未结 3 1345
栀梦
栀梦 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:12

    I'm not sure if you're using CocoaPods or not but this is a known issue being tracked on the AFNetworking Github page.

    I was able to fix this by adding the correct import statements directly to my `PROJECTNAME-Prefix.pch there I changed it to this.

    #ifdef __OBJC__
      #import 
      #import 
      #import 
    #endif
    

    If you have something else in there don't delete it. Just add the imports for SystemConfiguration and MobileCoreServices.

    For OS X:

    #ifdef __OBJC__
        #import 
        #import 
        #import 
    #endif
    

提交回复
热议问题