我有一个使用CoreText框架的应用程序。我可以在iPhone和iPad 1和2上成功运行该应用程序。
但是,我无法在xCode iPhone / iPad模拟器中运行该应用程序。我收到以下错误消息:
ld:警告:忽略文件为不受支持的文件格式生成的/Users/croydonbod/Documents/iDevelopment/MyApp/CoreText.framework/CoreText,文件不是要链接的体系结构(i386)
架构i386:"_CTFontCreateWithName“的未定义符号,引用自:-View drawRect: in View.o "_CTFramesetterCreateWithAttributedString",引用自:-View drawRect: in View.o "_CTFramesetterCreateFrame",引用自:-View drawRect: in View.o "_CTFrameGetVisibleStringRange",引用自:-View drawRect: in View.o "_CTFrameDraw",引用自:-View drawRect: in View.o "_kCTFontAttributeName",引用自:-View drawRect: in View.o "_kCTForegroundColorAttributeName",引用自:-View drawRect: in View.o ld:未找到体系结构的符号i386 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
有没有人能告诉我为什么会发生这种情况?
谢谢。
发布于 2012-07-07 02:05:27
看起来您将CoreText框架文件从SDK复制到您的应用程序中,而不是弱链接框架(这意味着将为设备或模拟器正确加载适当的框架)。
从您的项目中删除CoreText框架并重新添加它,确保取消选中"Copy item to destination folder“复选框,一旦添加了CoreText框架,请确保在您的项目中为CoreText框架设置了"Relative to SDK”位置。下面是它是如何为UIKit框架设置的:

https://stackoverflow.com/questions/11367411
复制相似问题