8

现在对 XCode 感到非常沮丧。我可以完美地从代码构建和运行。但是,尝试存档是一场灾难。

我创建了一个项目,然后将 .xcodeproj 拖到项目导航器上的 XCode 中。显示很好,很酷。父项目构建设置:

Other linker flags: -all_load, -ObjC

Target Dependencies : CocoaLibSpotify (subproject I'm incorporating)

Link Binary with Libraries : libCocoaLibSpotify.a

当我构建我的项目时,以下几行有效

#import "CocoaLibSpotify.h"
#import <CocoaLibSpotify.h>

但是,当我存档时,我的项目找不到这些文件。值得注意的是,子项目文件与父项目不在同一目录中。但是,这不是目标依赖/链接二进制文件与库的重点吗?为什么存档失败?这似乎应该比现在容易得多。

谢谢。

编辑:编译错误

In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/AppDelegate.m:12:  
In file included from  /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/ViewControllers/LoginViewControll er.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/GUI/BaseViewController.h:10:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/Managers.h:9:
In file included from /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/Managers/AppLogicManager.h:11:
In file included from   /Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/CoreDataObjects.h:13:
/Users/ericharmon/Projects/teamsync/teamsync/TeamSync/Classes/Model/CoreData/Track.h:13:9: fatal error: 'CocoaLibSpotify.h' file not found
#import <CocoaLibSpotify.h>
    ^
1 error generated.`
4

1 回答 1

16

Archive 在构建时使用不同的目录结构,这可能会很痛苦。User Header Search Paths通过将以下内容添加到应用程序目标的构建设置中,我找到了成功:

"$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/include"(包括引号)。

另外,请确保Always Search User Paths设置为Yes.

另外,我$CONFIGURATION_BUILD_DIR/include在我的Header Search Paths设置中有,但我认为这对存档没有帮助。

于 2012-11-28T10:37:37.357 回答