如何将项目前缀文件添加到照片扩展目标? [英] How to add the project prefix file to photo extension target?

查看:102
本文介绍了如何将项目前缀文件添加到照片扩展目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

主目标通常包含-Prefix.pch文件,其中定义了所有便捷导入。
例如,当使用带c ++的opencv时,

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

不幸的是,在iOS 8中使用新的Photo Extension目标时,此文件获取忽略了添加扩展目标中所需的所有文件的麻烦。有没有办法让这个前缀文件也适用于新目标?

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

推荐答案

您可以通过更改项目的构建设置来更改扩展名的前缀标题。首先,在Xcode中打开主项目窗口,然后从左侧列表中选择您的照片扩展目标。转到构建设置 - > Apple LLVM 6.0 - 语言,然后将预编译前缀标题设置为前缀标题到前缀标题的路径(您可以从主应用程序目标中的相应设置中复制它)。如果您看不到这些选项,请确保在窗口顶部选择全部,而不是基本

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.

这篇关于如何将项目前缀文件添加到照片扩展目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆