无法在Xcode 6中构建-Apple框架中的ARC问题 [英] Can't Build in Xcode 6 - ARC Issues in Apple Frameworks

查看:92
本文介绍了无法在Xcode 6中构建-Apple框架中的ARC问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到Xcode 6后,我无法再构建我的应用程序. Xcode会引发如下错误和警告:

Upon updating to Xcode 6, I can no longer build my app. Xcode is throwing errors and warnings like the following:

错误:

/Applications/Xcode-6.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ CoreData.framework /Headers/NSManagedObjectContext.h:121:5: 指向没有明确所有权的非常量类型'id'的指针

/Applications/Xcode-6.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h:121:5: Pointer to non-const type 'id' with no explicit ownership

警告:

/Applications/Xcode-6.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/ Foundation.framework /Headers/NSString.h:206:4: 警告:"__ strong"仅适用于Objective-C对象或块 指针类型;在这里输入'const char *'[-Wignored-attributes]

/Applications/Xcode-6.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:206:4: warning: '__strong' only applies to Objective-C object or block pointer types; type here is 'const char *' [-Wignored-attributes]

错误发生在CoreData.framework中,警告发生在Foundation.framework中.

The error is in CoreData.framework, the warning is in Foundation.framework.

这是我的构建日志的链接: http://pastebin.com/RCgV8Pj1

Here's a link to my build log: http://pastebin.com/RCgV8Pj1

我尝试使用Frameworks目录中的拖放操作以及Project-> Build Phases中的添加按钮来删除和重新添加我的框架.都不能修复该错误.我也尝试删除SharedPrecompiledHeaders目录.我还看到了,但是他的修复方法对我不起作用.我的项目中没有"Frameworks"目录.我什至甚至重新安装了Xcode 6.

I've tried deleting and re-adding my frameworks using both drag and drop from the Frameworks directory, and the add button in Project->Build Phases. Neither fixes the error. I also tried deleting the SharedPrecompiledHeaders directory. I also saw this, but his fix doesn't work for me. I have no "Frameworks" directory in my project. I even went as far as re-installing Xcode 6.

我认为这是某个地方的构建设置错误,但是我不知道会发生什么更改或应该更新什么.最初,在使用Xcode 6之后,我也无法在Xcode 5中进行构建,但是我还原了xcodeproj,它在较旧的版本中可以正常工作.

I assume this is an error with a build setting someplace, but I don't know what would have changed or what I should update. Initially after using Xcode 6 I couldn't build in Xcode 5 either, but I reverted my xcodeproj and it works fine in the older version.

推荐答案

请确保您的FRAMEWORK_SEARCH_PATHS中的项目设置或目标设置中没有Frameworks路径,因为它可能导致从两个iPhoneOS.platform读取标头.和iPhoneSimulator.platform,会在编译过程中引起警告,并在链接过程中引起错误.

Make sure you don't have a Frameworks path in your FRAMEWORK_SEARCH_PATHS in project settings or target settings, as it can cause headers to be read from both iPhoneOS.platform and iPhoneSimulator.platform, causing warnings during compilation and errors during linking.

如果您在项目中添加/更改框架,并且一旦重建Xcode的缓存,您就会自发出现该问题,您也将失去编译项目备份的能力,因为该错误位于Xcode上级别.

The problem can arise spontaneously if you add/change frameworks in your project and once Xcode's caches have been rebuilt, you also lose the ability to compile backups of your project because the bug is at the Xcode level.

请参阅:

我在'__ strong'中的答案仅适用于Objective-C对象或块指针类型;在此处输入"XXX"警告

这篇关于无法在Xcode 6中构建-Apple框架中的ARC问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆