Skip to main content

All Questions

1371 votes
18 answers
342k views

How can I disable ARC for a single file in a project?

I am using ARC successfully in my project. However, I have encountered a few files (e.g., in unit tests and mock objects) where the rules of ARC are a little more fragile right now. I recall hearing ...
casademora's user avatar
  • 69.5k
284 votes
8 answers
74k views

When converting a project to use ARC what does "switch case is in protected scope" mean?

When converting a project to use ARC what does "switch case is in protected scope" mean? I am converting a project to use ARC, using Xcode 4 Edit -> Refactor -> Convert to Objective-C ARC... One of ...
Ali's user avatar
  • 19.6k
211 votes
1 answer
73k views

Custom dealloc and ARC (Objective-C)

In my little iPad app I have a "switch language" function that uses an observer. Every view controller registers itself with my observer during its viewDidLoad:. - (void)viewDidLoad { [super ...
Niku's user avatar
  • 2,219
61 votes
4 answers
96k views

How to enable/disable ARC in an xcode project?

If a project has already been created with ARC disabled, how do I enable it and vice versa?
hollow7's user avatar
  • 1,506
50 votes
3 answers
47k views

How to disable Xcode4.2 Automatic Reference Counting

Today, I have update my xCode to 4.2 version, And I want to disable the ARC, I also search with the google. but can't fix my problem. According the search results, In the target setting, I can't ...
user501836's user avatar
  • 1,176
40 votes
2 answers
10k views

@property definitions with ARC: Is strong default now?

Just running the ARC refactoring tool on the new xcode 4.3.1 and noticed that my (nonatomic, retain) properties are being swapped out for just (nonatomic) instead of (nonatomic, strong) like in the ...
trapper's user avatar
  • 12k
36 votes
5 answers
23k views

Find where object is retained with ARC

I have an object that is being retained more than necessary (most likely due to a property that is strong instead of weak). Big codebase, so it's hard to find where. How can I find all the lines in ...
hpique's user avatar
  • 120k
35 votes
4 answers
3k views

Did the Target-Action design pattern became bad practice under ARC?

For years I've been following a great pattern called Target-Action which goes like this: An object calls a specified selector on a specified target object when the time comes to call. This is very ...
Proud Member's user avatar
  • 40.5k
34 votes
3 answers
13k views

How to disable ARC for a single file in Xcode 5?

I recently downloaded Xcode 5, and it's now my primary IDE. However, I now need to disable Automatic Reference Counting for a single file in my project. In Xcode 4, I went to the Build Phases tab ...
Undo's user avatar
  • 25.7k
33 votes
2 answers
10k views

How to know if my Xcode iPhone project is using ARC?

I want to know if my Xcode iPhone project is using ARC, and I can't remember if I ticked that box when creating the project. How can I get this information?
user avatar
33 votes
1 answer
21k views

@autoreleasepool without ARC?

I'm new to Xcode 4.2, and I'm not yet fully up to speed on ARC. However, I did read that @autoreleasepool replaces the manual use of autorelease pools and does some special magic under the hood to ...
fieldtensor's user avatar
  • 4,040
31 votes
1 answer
6k views

How to enable ARC for a file in Non-ARC project?

I know you can use -fno-objc-arc flag to disable ARC for files that NOT support ARC in an ARC project. Is there any way to enable ARC for files support ARC in a Non-ARC project? Thanks!
fannheyward's user avatar
  • 19.2k
29 votes
2 answers
18k views

After Auto-ARC Conversion: Assigning retained object to unsafe property; object will be released after assignment

I just converted an old project to ARC using Xcode's automatic refactoring. @property (nonatomic, retain) NSMutableArray *cards; was replaced by: @property (nonatomic) NSMutableArray *cards; This ...
Kenny Wyland's user avatar
  • 21.8k
24 votes
2 answers
9k views

Static library with ARC support linked to non-ARC project causing linker errors

I have a non-ARC project that uses an ARC-enabled static library. This is a supported scenario, so that everything works fine. That is, until I run the code on a 4.x device, including the Simulator. ...
zoul's user avatar
  • 104k
21 votes
2 answers
5k views

How can I disable ARC for an entire group/folder of files?

I'm aware that you can set the compiler flag -fno-objc-arc to disable Automatic Reference Counting (ARC) for each file in Compile Sources in XCODE but how can I do this for an entire group of files ...
Camsoft's user avatar
  • 12k

15 30 50 per page
1
2 3 4 5
25