How to add the project prefix file to photo extension target?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 15:55:41

问题


The main target typically contains a -Prefix.pch file where all the convenience imports are defined. E.g when using opencv with c++ there is

#ifdef __cplusplus
    #import <opencv2/opencv.hpp>
#endif

#ifdef __OBJC__
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
#endif

Unfortunately when using the new Photo Extension target in iOS 8, this file gets ignored making it a hassle to add all the files required in the extension target. Is there a way to make this Prefix file work also for the new target?

thx


回答1:


You can change your extension's prefix header by changing your project's build settings. First, open the main project window in Xcode and select your photo extension target from the list on the left. Go to Build Settings -> Apple LLVM 6.0 - Language, then set Precompile Prefix Header to Yes and Prefix Header to your prefix header's path (you can copy this from the corresponding settings in your main application target). If you can't see these options, make sure All is selected at the top of the window instead of Basic.



来源:https://stackoverflow.com/questions/26184358/how-to-add-the-project-prefix-file-to-photo-extension-target

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!