我今天安装了Xcode 4.5,我遇到了以下问题:
我使用工作区同时开发库和应用程序。当我在库中更改某些内容并构建应用程序时,将使用新更改重建库。这在Xcode 4.3 / 4.4中工作正常。 但是,从Xcode 4.5开始,这似乎不再起作用了。我总是要“清理”项目,否则更改是不可见的,尽管目标是按照正确的顺序构建的(lib,app)。
有没有人经历过同样的事? 是否存在变通方法?
- 亚历山大
答案 0 :(得分:1)
这是一个可能的原因(可能还有其他原因):
确保显示“身份和类型”检查器,然后在应用程序的项目(而不是库)中选择libWhatever.a文件。如果您看到位置:相对于项目,这是您的问题。
老实说,你最好直接编辑pbxproj。你的补丁看起来像这样:
Index: App.xcodeproj/project.pbxproj
===================================================================
--- App.xcodeproj/project.pbxproj (revision 28061)
+++ App.xcodeproj/project.pbxproj (working copy)
@@ -28,7 +28,7 @@
/* Begin PBXFileReference section */
A7052F8F1358BFCC00178DAC /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; };
- A74F787413566130000D0AFC /* libLibrary.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libLibrary.a; sourceTree = SOURCE_ROOT; };
+ A74F787413566130000D0AFC /* libLibrary.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libLibrary.a; sourceTree = BUILT_PRODUCTS_DIR; };
A74F787D135665A3000D0AFC /* Macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Macros.h; path = DslExt/Macros.h; sourceTree = "<group>"; };
A74F787E135665A3000D0AFC /* Foundation-dsl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "Foundation-dsl.m"; path = "DslExt/Foundation-dsl.m"; sourceTree = "<group>"; };
A74F787F135665A3000D0AFC /* Foundation-dsl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Foundation-dsl.h"; path = "DslExt/Foundation-dsl.h"; sourceTree = "<group>"; };
我在这里找到了这个答案:
What's the correct way to configure XCode 4 workspaces to build dependencies when needed?