我把包含的Xcode项目拖到我的’Groups& “文件”窗格并选择“将其添加到我的项目”.然后我将Parsekit.framework拖到Link Binary With Libraries标题下面.然后我双击我的目标应用程序并添加Parsekit作为直接依赖项.我还将libicucore.dylib添加为链接库(正如它在其网站上所说的那样).最后,在我的目标信息的Build settings选项卡中,我将Header搜索路径设置为/ Users / path / to / include /目录,将Other Linker Flags设置为-ObjC -all_load.
将此作为调试版本运行正常,没有错误.但是,当我构建我的应用程序以发布然后尝试运行创建的可执行文件时,应用程序无法加载以下错误消息:
MyApp cannot be opened because of a problem. Check with the developer to make sure myApp works with this version of Mac OS X.
这是崩溃记者的转储:
Process: MyApp [11658] Path:@H_403_25@ /Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp@H_403_25@ Identifier: com.yourcompany.MyApp@H_403_25@ Version: ??? (???) Code Type:@H_403_25@ X86-64 (Native) Parent Process:@H_403_25@ launchd [135] Date/Time:@H_403_25@ 2010-05-24 17:08:08.475 +0100 OS@H_403_25@ Version: Mac OS X 10.6.3 (10D573)@H_403_25@ Report Version: 6Interval Since Last@H_403_25@ Report: 133300 sec Crashes@H_403_25@ Since Last Report: 3 Per-App@H_403_25@ Crashes Since Last Report: 3@H_403_25@ Anonymous UUID:@H_403_25@ DF0265E4-B5A0-45E1-8B71-D52A27CFDDCA
Exception Type: EXC_BREAKPOINT@H_403_25@ (SIGTRAP) Exception Codes:@H_403_25@ 0x0000000000000002,0x0000000000000000@H_403_25@ Crashed Thread: 0
Dyld Error Message: Library not@H_403_25@ loaded:@H_403_25@ @executable_path/../Frameworks/ParseKit.framework/Versions/A/ParseKit@H_403_25@ Referenced from:@H_403_25@ /Users/Garry/Programming/Xcode/Mac/MyApp/build/Release/MyApp.app/Contents/MacOS/MyApp@H_403_25@ Reason: image not found
Model: MacBookPro5,5,BootROM@H_403_25@ MBP55.00AC.B03,2 processors,Intel@H_403_25@ Core 2 Duo,2.53 GHz,4 GB,SMC 1.47f2@H_403_25@ Graphics: NVIDIA GeForce 9400M,NVIDIA@H_403_25@ GeForce 9400M,PCI,256 MB Memory@H_403_25@ Module: global_name AirPort:@H_403_25@ spairport_wireless_card_type_airport_extreme@H_403_25@ (0x14E4,0x8D),Broadcom BCM43xx 1.0@H_403_25@ (5.10.91.27) Bluetooth: Version@H_403_25@ 2.3.1f4,2 service,2 devices,1 incoming serial ports Network Service:@H_403_25@ AirPort,AirPort,en1 Network Service:@H_403_25@ Ethernet Adaptor (en6),Ethernet,en6@H_403_25@ Serial ATA Device: Hitachi@H_403_25@ HTS545025B9SA02,232.89 GB Serial ATA@H_403_25@ Device: HL-DT-ST DVDRW GS23N USB@H_403_25@ Device: Built-in iSight,0x05ac@H_403_25@ (Apple Inc.),0x8507,0x24400000 USB@H_403_25@ Device: Internal Memory Card Reader,@H_403_25@ 0x05ac (Apple Inc.),0x8403,@H_403_25@ 0x26500000 USB Device: IR Receiver,0x8242,@H_403_25@ 0x04500000 USB Device: Apple Internal@H_403_25@ Keyboard / Trackpad,0x05ac (Apple@H_403_25@ Inc.),0x0237,0x04600000 USB Device:@H_403_25@ BRCM2046 Hub,0x0a5c (Broadcom@H_403_25@ Corp.),0x4500,0x06100000 USB Device:@H_403_25@ Bluetooth USB Host Controller,0x8213,0x06110000
在构建应用程序之后,除了可执行文件之外,Xcode还创建了一个名为MyApp.app.dSYM的文件.知道那是什么意思吗?
我在运行10.6.3的Intel MBP上使用Xcode 3.2.2进行开发.
非常感谢您提供的任何帮助.
编辑:新问题!@H_403_25@非常感谢diciu的建议 – 最初我认为他们已经解决了这个问题.但是,我将已编译的应用程序复制到我妻子的Macbook(英特尔,运行10.6.3),但它不会启动.相反,我收到以下错误消息:
您无法打开应用程序MyApp,因为此类型的Mac不支持它.
在MyApp的Build设置中,我将Valid架构设置为i386 x86_64,因此它应该可以工作.这可能是由什么引起的?
编辑:问题解决了@H_403_25@我无意中在Build设置中检查了Build active architecture only标志.取消选中此问题解决了我的问题.非常感谢!
解决方法
右键单击您的目标,选择“添加” – > “新建阶段” – > “新建复制文件构建阶段”.@H_403_25@对于目的地,请选择“框架”.
在新创建的构建阶段,拖动您的Parsekit框架.
构建目录中的dsym包包含debugging symbols.