在启用 ARC 的项目中使用非 ARC 代码 - 添加 Facebook [英] Using Non-ARC Code in an ARC-Enabled Project - Adding Facebook

查看:21
本文介绍了在启用 ARC 的项目中使用非 ARC 代码 - 添加 Facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我创建我的项目时,我让它支持 ARC,所以我的项目将支持 iOS 4.3 及更高版本.

When i created my project, i made it to support ARC, so my project will support iOS 4.3 and above.

现在我需要将 Twitter 和 Facebook 集成到它.两家公司提供的 Facebook 和 Twitter 框架都不支持 ARC.

Now i need to integrate Twitter and Facebook to it. Both Facebook and Twitter frameworks given by the companies does not support ARC.

大部分文件都有dealloc,并且释放了它的变量.有人说要废弃该项目并重做它以禁用 ARC.但是,我负担不起这样做,因为我已经完成了大部分工作.

Most of the files have dealloc, and released its variables. Some say to scrap the project and redo it disabling ARC. But, i can't afford to do this, since i have done most of the stuff.

我添加了 FBConnect 文件(其中有 4 个)并添加了 -fno-objc-arc,如 本教程.我仍然得到

I added the FBConnect files (there were 4 of them) and added -fno-objc-arc as described in this tutorial. Still i get

file://localhost/Users/illepmorgan/Documents/Projects/illep/untitled%20folder/alphaproject/alphaproject/FBRequest.m: error: Automatic Reference Counting Issue: Existing ivar '_delegate' for unsafe_unretained property 'delegate' must be __unsafe_unretained

我需要帮助,我不能重做.

I need help, i can't redo this again.

推荐答案

确保您将 -fno-objc-arc 标志添加到每个实现文件(.m 文件).

Make sure that you added the -fno-objc-arc flag to each implementation file (.m file).

然后清理项目(项目菜单 -> 清理)并再次构建.在课堂上这样做时,我有时不得不清理和构建两次.好像是个小bug.

And then clean the project (Project menu -> clean) and build again. I have sometimes had to clean and build twice when doing this in class. Seems like a little bug.

这篇关于在启用 ARC 的项目中使用非 ARC 代码 - 添加 Facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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