Could not disable ARC in xcode4.2 - iphone

I am working on ARC environment and I successfully disable Facebook API through -fno-objc-arc. I also want to disable this for my own class, and I did same method as with Facebook API classes, but I couldn't disable ARC. If anyone know please help me on that.

To get rid of this error you need to disable ARC, to disable ARC from your project do the following steps.
Select your project file.
You should be in the “Build settings” tab. Select the “levels” option (default is “Combined”)
There’s a search field to the right of “Combined”. Enter “Automatic”
Second group should be “Apple LLVM Compiler 3.0 – Language”. Second line under that controls ARC.
Click that line, then in the middle column (where it says “yes”), click and choose “no”.
Now the error should gone.

Just to make sure you are doing this in the right place:
In the project navigator, click on the top item, the project name
In the pane that appears with project and targets, select the correct target where the non-arc file is included
Go to Build Phases, open Compile Sources
Select the file that needs to be non-arc, double click it, and enter -fno-objc-arc
Build.
So double check you did this, especially selecting the right target.

Related

cant see the errors in my project - Exclamation mark

When I'm trying to run my project it said that i have an errors in my project, but i can't see any. I have an Exclamation mark on my project. If I'm trying to run other project, it is run perfectly.
Before that happened, I played a little bit with the project library and tried to copy some jars to the library. I tried to copy the jars manual to.
Thanks!
did you try the "Problems" View? This should show additional information.
The easiest Way to get there:
Ctrl + 3, then type "Problems".
-Hannes
Besides the "Problems" view, there is also the Console that could give you some hints.
For the Console View, there is the problem that it can show different subviews; for example it can show the console for Android or the console for DDMS. In the toolbar at the upper right of the Console view, you will find the control to choose the right console to display. Be sure to choose the "Android Console".
Another possibility is to use the "Fix Project Properties" that you will find by right clicking on the projet => Android Tools -> Fix Project Properties. This will fixes some but not all the potential problems that you might have introduced in your project.
For the rest, check in detail all properties of the project.

www folder not found after i created cordova based application in xcode

I created a Cordova based application in XCode, and when I tried to the www folder of my project I did not find it.
Can anyone advise me where to find the www folder that should be included in the project?
Check the tutorial provided by the online doc very carefully:
http://docs.phonegap.com/en/1.5.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS
Normally, when creating your project, you should have turned off the ARC:
In case you forgot to turn the ARC off, you may try the following:
Select your project file.
Select the Build settings tab, and select the filter options All and levels (default is Combined).
In the search field to the right of the filter option Combined, enter automatic.
There will be a group called Apple LLVM Compiler 3.0 – Language containing the line Objective-C Automatic Reference Counting.
Click that line, then in the middle column (where it says yes), click and choose no.
The above should turn your ARC off.
Then, try following the next steps of the project creation:
You should see your project in Xcode 4 now. Press the Run button in
the top left corner. Your build should succeed and launch in the
simulator
You should see a error in your simulator informing you
index.html was not found
To fix this, we need to copy the www
directory into the project. Right click on the project in the left
navigation window and click show in finder
In Finder, you should see
the www directory beside your project
Next step is IMPORTANT! Drag the www folder into Xcode 4. You can't
just drag the www folder into your app's folder. It needs to be
dragged into Xcode 4!! In my case I would drag it and drop it on
HiWorld shown below.
After you drag, you should see a prompt with a few options. Make sure
to select Create folder references for any added folders. Click Finish
Continue from step 4.HelloWorld of the online doc...
Hope this helps.

having errors when import class non-Automatic Reference Counting to my project

Just create new project and checked Automatic Reference Counting and downloaded another project.
when I import the downloaded classes to my project, it gives too much errors, after searching I found that because the downloaded project is non-Automatic Reference Counting .
so, what is the solution for this problem please ?
This occurs because calls like "release" cause errors in ARC projects so that you don't use them because the compiler does this for you. To keep ARC enabled on your classes and disable it on the class you've imported go to your build phases and add the compiler flag "-fno-objc-arc" to the class that you want to use manual memory management.
Those files need to be flagged to the compiler so the compiler does not use ARC with them. Use the -fno-objc-arc flag. Click on your project file, click on your application's target, click on the "Build Phases" tab, expand on "Compile Sources", and double click on the files without ARC. Once a little window pops up, put the -fno-objc-arc flag on those files.

Convert App to ARC while ignoring files?

I want to convert my app to ARC but I have some external librarys and frameworks that are not complaint with ARC. I know when yous start a new project using ARC, you can later specify which files to ignore. But can you do this when upgrading an existing app to ARC?
in XCode, go to your active target and select the Build Phases tab. In the Compiler Flags column, set -fno-objc-arc for each of the files you don't want ARC
EDIT:
Also, to have the opposite behavior, I mean to use a file that was written using ARC inside a non ARC project, you can set the file flag to -fobjc-arc instead
There is plenty of more info regarding ARC here: http://clang.llvm.org/docs/AutomaticReferenceCounting.html#general
ARC may be explicitly enabled with the compiler flag -fobjc-arc. It may also be explicitly disabled with the compiler flag -fno-objc-arc. The last of these two flags appearing on the compile line "wins".
Source: http://clang.llvm.org/docs/AutomaticReferenceCounting.html
To add to Felipe's answer, if you want to add this to multiple files at once:
Select all the files you want to exclude form ARC
Press 'Enter'
The pop-up box will appear at the last file in the list
Type -fno-objc-arc

XCode 3.2.4 Project - no "other linker flags" in build settings visible

I am recently trying to connect my cocos2d game with open feint, but I can't accomplish it as there seem to be some settings missing in my build settings of any project that I create.
For example, I have to check "Call c++ Default ctors/Dtors in objective c", but there isn't such an option in my build settings. What's wrong with that?
Here is a picture:
http://img413.imageshack.us/img413/3425/bildschirmfoto20101023u.png
My project is the one on the left, I downloaded the right one. I need to my build settings to like like the ones on the right. Is that somehow possible?
In the image, you have the build settings windows set to show "settings defined at this level". Since you haven't yet changed the other linker flags setting, naturally it doesn't show up. If you show all settings, you should see it.