CocoaLumberjack and ARC

172 views
Skip to first unread message

Davy De Waele

unread,
Jan 2, 2012, 7:19:33 PM1/2/12
to cocoalu...@googlegroups.com
Hi,

I have an application targetted for iOS 4 and 5 that was using an "old" version of CocoaLumberjack. Everything was running great except for 1 small memory leak.
After that leak was fixed (very quickly) by the devs (https://github.com/robbiehanson/CocoaLumberjack/issues/14), I decided to start using the latest version.

And that's when my troubles began.... AFAIK, CocoaLumberjack uses ARC now and apparently the version I was working with earlier didn't

As I'm simply copying the CocoaLumberjack source files in my project, I was facing issues (as I'm not using ARC and have no immediate desire to convert my entire project).
I was getting the issue described here : https://github.com/robbiehanson/CocoaLumberjack/issues/11
Setting the "-fobjc-arc"  flag on the CocoaLumberjack files didn't resolve the issue.

Is there any way I can get this to work without converting my project to ARC? 

Regards,
Davy

Michael Sedlaczek

unread,
Jan 3, 2012, 3:52:17 AM1/3/12
to cocoalu...@googlegroups.com
Hi Davy,

The flag for the CocoaLumberjack files should be "-fno-objc-arc" (the "no" makes the difference). That should would just fine.

Cheers,
Michael

Robbie Hanson

unread,
Jan 3, 2012, 3:55:49 AM1/3/12
to cocoalu...@googlegroups.com
The wiki has some information concerning ARC, including instructions on how to include ARC files in a non-arc project, as well as which branches/tags are pre-arc.


Setting the "-fobjc-arc"  flag on the CocoaLumberjack files didn't resolve the issue.

This may have to do with the compiler you're using. See the wiki article for more information.

Let me know if you have any questions or run into any issues. I have little doubt you won't be the only one to face these issues. So any additional troubleshooting / tips should I'd like to add to the wiki.

-Robbie Hanson



--
You received this message because you are subscribed to the Google Groups "CocoaLumberjack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cocoalumberjack/-/QWtCi9dEY2MJ.
To post to this group, send email to cocoalu...@googlegroups.com.
To unsubscribe from this group, send email to cocoalumberja...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cocoalumberjack?hl=en.

Davy De Waele

unread,
Jan 3, 2012, 7:12:33 AM1/3/12
to cocoalu...@googlegroups.com
Thx for the quick reply ! Missed that Wiki article.... I'll provide feedback in a couple of hours...

Davy De Waele

unread,
Jan 3, 2012, 12:10:25 PM1/3/12
to cocoalu...@googlegroups.com
Hi,

I have the correct development and deployment requirements for ARC as mentioned in the Wiki article (using Apple LLVM compiler 3.0), and have set the flag on the cocoalumberjack classes but I'm facing the dyld: lazy symbol binding failed: Symbol not found: _objc_storeStrong issue described here 



Robbie Hanson

unread,
Jan 3, 2012, 1:12:39 PM1/3/12
to cocoalu...@googlegroups.com
I'm glad they quoted me on the stack overflow article. I had already forgot what I had discovered when I was testing this particular issue earlier.

There seems to be a bug in (maybe) the LLVM compiler. Here's what I've discovered:

If you have an Xcode project without ARC turned on by default, and you have a file that uses ARC (via -fobjc-arc), and that file attempts to alloc/init stuff within '+ (void)initialize', then it will blow up at runtime.

It seems to work, however, if you convert the project to ARC…

When I wrote that I was referring to the Apple LLVM 3.0 version. Haven't tested yet on the 3.1 betas…

But this is a rather difficult problem to get around, and one that several people are encountering. It may be worth it to create a 1.2.X branch (that's still non-arc), and cherry-pick any major bug-fixes into it.  At least until this bug gets fixed (in a non beta release of Xcode).

-Robbie Hanson



--
You received this message because you are subscribed to the Google Groups "CocoaLumberjack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cocoalumberjack/-/z7Odur0OF1AJ.

Robbie Hanson

unread,
Jan 3, 2012, 1:17:53 PM1/3/12
to cocoalu...@googlegroups.com
Just pushed a 1.2.X branch that's non-arc.  I cherry picked the memory leak fix too.

-Robbie Hanson



On Jan 3, 2012, at 9:10 AM, Davy De Waele wrote:

--
You received this message because you are subscribed to the Google Groups "CocoaLumberjack" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cocoalumberjack/-/z7Odur0OF1AJ.
Reply all
Reply to author
Forward
0 new messages