İçeriğe atla
13/12/2011 / Mustafa Ferhan Akman

How to use non-ARC files with ARC compiler

One of  mobile app development team in my company has been working with iOS 5 for a few days. But, last day they want to use several open source library and sdk like Facebook SDK, ASIHTTPRequest, AsyncImageView etc.. But they didn’t work with these libs throught ARC (automatic reference counting). Because, some Objective-C syntax usage is removed or changed if you use to ARC.

They asked tome for solving this problem. My first way, I tried to convert non-ARC files to ARC files trough XCode and  I have edited several lines of codes manually. Firstly,  for this process, I have worked with last Facebook SDK for iOS. I have converted for ARC successfully. But, this process took about 30 minutes.  And secondly, I tried work with ASIHTTPRequest libraries but, I couldn’t.

But last night, I think, I have found correct way. I have discovered, how the compiler flag usage. It’s simple, if you don’t want to use ARC compiler for some files, you can use -fno-objc-arc  flags in XCode 4-> target -> Build Phases -> Compile Sources.

Bir Yorum

Yorum yapın
  1. J / Oca 10 2012 8:55 pm

    I love you. You put an end to two days of frustration – thank you.

Yorum yapın

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Değiştir )

Twitter picture

You are commenting using your Twitter account. Log Out / Değiştir )

Facebook photo

You are commenting using your Facebook account. Log Out / Değiştir )

Connecting to %s

Follow

Get every new post delivered to your Inbox.