我可以对尝试运行项目时遇到的以下错误提供一些帮助。
我的项目已经发布了In App Purchase。 在我的最新版本中,我尝试将IAP合并到另一个视图控制器中,但是当我想要运行时,我得到两个Apple Mach-O链接器错误和Dsymutil错误。
自从我上次发布的版本以来,我可能已经更新了Xcode(版本4.6(4H127)),但我不确定。
我已经检查了一些事情:
全局变量在.h文件中声明,该文件在需要它的视图控制器中导入: extern NSArray * _products;
我不确定我的外部框架/库会造成任何麻烦。他们之前工作得很好:TestFlight,Appirater,CHCSVParser。
错误:
Ld" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app/Mijn Kinderen"正常的i386 cd" / Users / jaspervandermaarel / Documents / Xcode projects / Mijn Kinderen" setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/ usr / bin:/仓:/ usr / sbin目录:/ sbin目录" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6。 1.sdk -L / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator" -L / Users / jaspervandermaarel / Documents / Xcode projects / Mijn Kinderen / TestFlightSDK1- 1" " -L / Users / jaspervandermaarel / Documents / Xcode projects / Mijn Kinderen" -F / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator -filelist" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Intermediates / Mijn Kinderen.build/Debug-iphonesimulator/Mijn Kinderen.build/Objects-normal/i386/Mijn Kinderen.LinkFileList" -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min = 5.0 -weak_framework Accounts -weak_framework Social -framework SystemConfiguration -framework CFNetwork -framework StoreKit -framework MessageUI- lz -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -lTestFlight -o" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app / Mijn Kinderen"
架构i386的未定义符号:" __ products",引自: - MKGebeurtenissenViewController.o中的[MKGebeurtenissenViewController voegToeGebeurtenis:] - MKGebeurtenissenViewController.o中的[MKGebeurtenissenViewController alertView:clickedButtonAtIndex:] - MKKinderenViewController.o中的[MKKinderenViewController alertView:clickedButtonAtIndex:] - MKKinderenViewController.o中的[MKKinderenViewController productPurchased:] - MKKinderenViewController.o中的[MKKinderenViewController voegKindToe:] - MKGebeurtenissenViewController.o中的[MKGebeurtenissenViewController voegToeGebeurtenis:] - MKGebeurtenissenViewController.o中的[MKGebeurtenissenViewController alertView:clickedButtonAtIndex:] - MKKinderenViewController.o中的[MKKinderenViewController alertView:clickedButtonAtIndex:] - MKKinderenViewController.o中的[MKKinderenViewController productPurchased:] - MKKinderenViewController.o中的[MKKinderenViewController voegKindToe:] ld:找不到架构i386的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
GenerateDSYMFile" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app.dSYM" " / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app/Mijn Kinderen" cd" / Users / jaspervandermaarel / Documents / Xcode projects / Mijn Kinderen" setenv PATH" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/ usr / bin:/仓:/ usr / sbin目录:/ sbin目录" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app/Mijn Kinderen" -o" / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app.dSYM"
错误:无法打开可执行文件' / Users / jaspervandermaarel / Library / Developer / Xcode / DerivedData / Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky / Build / Products / Debug-iphonesimulator / Mijn Kinderen.app/Mijn Kinderen'
答案 0 :(得分:1)
并非“extern
”不好,您只需要在某些内容声明 真实 “NSArray
”。 m文件在某处,否则对象实际上没有被分配到任何地方。
因此,如果在.h文件中声明“extern
”变量,请在支持该.h文件的.m文件顶部声明实际变量。
E.G。
NSArray * _products;
在“@implementation
”位之前。并确保你做 alloc&在.m文件中的某处初始化该变量。