Я пытаюсь использовать SDWebImage в проекте IOS.
Я следую этим инструкциям из их github:
import the project as a static library.
Add the SDWebImage project to your project
Download and unzip the last version of the framework from the download page
Right-click on the project navigator and select "Add Files to "Your Project":
In the dialog, select SDWebImage.framework:
Check the "Copy items into destination group's folder (if needed)" checkbox
Add dependencies
In you application project app’s target settings, find the "Build Phases" section and open the "Link Binary With Libraries" block:
Click the "+" button again and select the "ImageIO.framework", this is needed by the progressive download feature:
Add Linker Flag
Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag:
Import headers in your source files
In the source files where you need to use the library, import the header file:
#import <SDWebImage/UIImageView+WebCache.h>
Но я получаю эту ошибку:
SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc
Я попытался найти пути поиска заголовков, которые говорят некоторые другие ответы, и я получаю следующие результаты:
Always search user paths -No
Header search paths
User header search paths
Должен ли я установить значение там? Или я должен сделать что-нибудь еще?
Еще одна вещь, которую я заметил в их демонстрации, заключается в следующем: в их демонстрации в папке frameworks они импортировали .xcodeproject sdwebimageview, а я импортировал sdwebimageview.framework, как говорится в инструкциях на github.
Спасибо!
Редактировать: мой проект не является Arc.
Я попытался изменить other Linker flags from -ObjC to fobjc-arc
, но все равно получаю ту же ошибку.
1) это правильно или нужно что-то изменить? 2) если я поменяю свой проект с недугового на дуговой, что мне изменить? Я хочу использовать только эту библиотеку, поэтому предпочитаю не менять ее.
В файле .h os SDWebImage говорится:
#if !__has_feature(objc_arc)
#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag
#endif