How do you include SSZipArchive for IOS 5?

前端 未结 2 579
北恋
北恋 2021-02-14 11:19

For the project I\'m working on I needed to unzip certain files. For this, I found the library SSZipArchive. I included this in Xcode 4.2 (Right-click on the Classes folder->Add

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-14 11:54

    After a lot of headaches, I figured out what was the problem. It turned out to be _Prefix.pch. I totally looked over it, but it turns out that I had the following line there:

    #import "someclass.h"
    

    This class was being loaded in with the .c-files of the minizip library, resulting in Objective-C headers being included in .c-files, which was something that XCode did not like. Wrapping these statements in an #ifdef statement fixed the problem:

    #ifdef __OBJC__
       #import "someclass.h"
    #endif
    

提交回复
热议问题