I have a app with the WhiteRaccoon framework installed.
I cant compile it as it gives me errors with anything to do with retain or release in WhiteRaccoon.m/h.
Any ideas whats going on?
Thanks.
By the way, I have added the CFNetwork framework. Any ideas?
Your project is probably using ARC and WhiteRaccoon probably isn't.
You can either convert whiteRaccoon (whatever that is) to ARC or exclude the whiteRaccoon files by adding the following compiler flags to it's source files -fno-objc-arc.
To do that click the project on the left hand side then go to the "Build Phases"-> "Compile Sources" look for the white Raccoon .m files and add the -fno-objc-arc under the compiler flags section.
Another option would be to compile the WhiteRaccoon framework into a static library and as this to your project.
Related
I am currently experiencing an issue with ARC in Xcode6: I have disabled ARC in the Build Settings of my project, however I am getting some errors in my test files, which appear to be complaining about ARC even if I disabled it.
The error messages state: "autorelease is unavailable: not available in automatic reference counting"
Does any of you have any idea why?
When I imported some external libraries, I linked them to both my project and its test files, could that be the issue?
You can mark files as non-arc on a class by class basis by adding -fno-objc-arc in Compile Sources of your Build Phase. This answer should help you achieve that.
I am trying to use a set of C libraries to allow custom graphs in my iOS project. My projects uses ARC, however, the custom graph libraries are based on a project that does not use ARC. The errors I am getting are related to ARC.
The documentation for the C libraries specify that when using the library to turn off ARC. However, my project is too evolved to revert to a non ARC project.
How might I still use this library in my project? The library is PowerPlot.
You can turn off ARC for the specific library, by adding the -fno-objc-arc compiler flag.
Go in your Target Settings > Build Phases > Compile Sources, and add the compiler flag to every implementation file from the library.
Further information can be found here: How can I disable ARC for a single file in a project?
I'm trying to add the Mixpanel SDK to an iOS app that uses ARC. After adding the SDK I get some compile errors related to ARC usage. How can I integrate Mixpanel into a project that uses ARC?
In my personal projects I always manage mempory manually. Perhaps there's some way to tell the compiler this code uses ARC while this code doesn't.
Click on your project name in the navigator. Choose "Build Phases" from the list header in the right hand window. You should see a bar named "Compile Sources"; expand it and you should see a list of the source files in the project and a column labeled "Compiler Flags". For every file in the Mixpanel SDK, double-click in this column and add the following line:
-fno-objc-arc
This will signal the compiler to not use Automatic Reference Counting when compiling these files. If you ever need to do the reverse (compile ARC code in a non-ARC project) do the same thing but add this line instead:
-fobj-arc
I believe this may be a duplicate of this question.
I have already created a project in XCode 4.2 with ARC checked. The problem is that I have to download and add the ASIHttpRequest files. This is giving a whole bunch of errors when I try to compile. Is there some way to fix this (other than to create a project again) ?
Click on the name of the project on the navigation view in the left side, go to Targets -> Build Phases and add -fno-objc-arc to the "compiler flags" for any relevant files.
You can turn off ARC per-file by passing the flag -fno-objc-arc to each as they are compiled. Add the flag to the files that need ARC disabled in the Compile Sources group under the target in the project navigator.
Another option would be to compile ASIHttpRequest as its own framework that doesn't have ARC enabled and just link against the framework. Speak of, isn't ASIHttpRequest already in a framework? (I've not looked at it in a while)
Keep using ARC, but disable it for the ASIHttpRequest files. This answer should point you in the right direction:
How can I disable ARC for a single file in a project?
I am trying to get this sorted out. I know how to get an ARC project working with files or static lib's that are not using ARC. For instance, using the compiler flags -fno-objc-arc.
But what if I have a project that is not using ARC and want to include a static library compiled with ARC? Every time I want to build the project it is telling me that it doesn't recognize things like "strong, __unsafe_unretained,...".
To add on to shw's answer. Add -fobjc-arc to compiler flags under build phases to ARC files to make them compile correctly for non-ARC projects.
More info here
It should work fine - are you sure you're using the newest Apple compiler with this non-ARC project and not the GCC one?