Is there an iOS 5 arc compatible lazy Image loading library? I've not found one.
My next thought is to make EGOlazyloading a compiled library and link it to my project. Would that work? Any pointers on going about?
Thanks!
I wrote one. You can download it here:
https://github.com/nicklockwood/AsyncImageView
Alternatively, if you do want to use EGO, or some other library, select Edit>Refactor>Convert to ARC and in the dialog that comes up there's a little drop down to select which files to convert.
Just tick the files that should be converted to ARC and un-tick ones which shouldn't be. If a file is already using ARC then leave it ticked (it won't double convert it).
That gives you the option of either trying to convert the library files to ARC or to leave them alone. Files that are unticked will be marked with the -fno-objc-arc flag automatically so you won't have to do anything.
Byron, you could just use a regular library like EGOlazyloading you suggested and order the compiler not to use ARC on those specific files by adding the flag -fno-objc-arc in "Build Phases -> Compile Sources"
Related
This question already has an answer here:
Include non-ARC library in an ARC app?
(1 answer)
Closed 8 years ago.
I am facing one issue while I am adding personal non ARC framework in my ARC project. Many errors are there like ARC forbids Objective-C objects in structs. For this I dont want to opt for this solution: "__unsafe_unretained". I want to know from you all expert people that is there any way so that I can add my non arc framework in ARC enabled project?
First you need to add compiler flags in Xcode ->Targets -> Build Phases -> Compile Sources.
Just double click on the column of the row under compiler flag, here you can select multiple file by using cmd and then can disable the ARC for framework, u need to add the -fno-objc-arc in every perticular file.
Now clean and build the project and run, it'll work fine..
go to your project's target-> build phases->compile sources->file you want to disbale ARC-> double click on file and write -fno-objc-arc
I'm writing a program for iOS and want to use the Apache Portable Runtime and the Subversion C library in my project.
Since this is the first time I'm trying to do this I have no idea where to start.
I already made a new C/C++ library project, imported all apr.h and svn.h files in the project, set the sdk to iOS7
It compiles well and it outputs an .a file but when I import it into my project it doesn't get linked or something.
Could anybody know a tutorial or maybe a svn library for objective c? Or at least point me in a right direction.
The only results I get while googling it are:
"Objective-C should support C Libraries natively, this should be very easy"
Not so easy for me I suppose. ;)
This is how you can troubleshoot:
Click your blue project icon.
Select the Build phases tab in your main view.
Expand "link with libraries".
Make sure your .a file is in this list. If not add it.
If you still have problems check your build logs (right most icon on left pane). The build logs contain a long list of what your compiler did. There are icons to the far right looking like 5-6 lines on top of each other. Actually the icon is hidden until you hover over it.
Clicking this will expand a compiler step and show you exactly what arguments were provided to your compiler. This will be pretty long so it might be smart to copy to an editor. But it will contain switches such as -I for including header files, -L for location of libraries etc. Check that your .a file is in fact included during compilation of the code which depends on it. Should be a -l switch I believe.
If you have the sourcecode of the C project, you can directly put all the source code into your project. Xcode knows how to compile C code and it will just be compiled with the rest of your project.
As mentioned by #Adam-Smith, you can directly interface with the C objects in your Objective-C code and the C objects will not be managed by ARC
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 am trying to update my project to use ARC and I use JSONKit so I went in the 'Build Phases' tab under 'Compile Sources' and added the argument '-fno-objc-arc' but I still get errors all over the place. I thought that was suppose to prevent this from happening?
What am I missing on this?
That is correctly how you implement it. What files did you include that flag on.
I am using AFNetworking and I had to put that flag on each file that AFNetworking had me include.
Adding to each file allowed the arc processor to ignore these files.
are you sure it is all lower case and that there are no spaces in the wrong places?
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?