简体   繁体   English

在启用ARC的项目中使用非ARC代码 - 添加Facebook

[英]Using Non-ARC Code in an ARC-Enabled Project - Adding Facebook

When i created my project, i made it to support ARC , so my project will support iOS 4.3 and above. 当我创建我的项目时,我支持ARC ,所以我的项目将支持iOS 4.3及更高版本。

Now i need to integrate Twitter and Facebook to it. 现在我需要将Twitter和Facebook集成到它。 Both Facebook and Twitter frameworks given by the companies does not support ARC . 这两家公司提供的Facebook和Twitter框架都不支持ARC

Most of the files have dealloc, and released its variables. 大多数文件都有dealloc,并释放了它的变量。 Some say to scrap the project and redo it disabling ARC. 有人说废弃该项目并重做它禁用ARC。 But, i can't afford to do this, since i have done most of the stuff. 但是,我做不起,因为我完成了大部分工作。

I added the FBConnect files (there were 4 of them) and added -fno-objc-arc as described in this tutorial . 我添加了FBConnect文件(其中有4个)并添加了-fno-objc-arc ,如本教程中所述 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. 我需要帮助,我再也不能重做了。

Make sure that you added the -fno-objc-arc flag to each implementation file (.m file). 确保为每个实现文件(.m文件)添加了-fno-objc-arc标志。

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. 看起来像一个小虫子。

there is actually a much easy way working in mixed ARC and Facebook none ARC . 实际上有一种很简单的方法可以在混合ARC和Facebook中使用ARC。 see my post on how to use it http://nabtech.wordpress.com/2012/02/02/facebook-ios-sdk-and-arc/ 看我的帖子关于如何使用它http://nabtech.wordpress.com/2012/02/02/facebook-ios-sdk-and-arc/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM