Top "Automatic-ref-counting" questions

Automatic Reference Counting (ARC) is a compiler feature that provides automatic memory management of Objective-C and Swift objects.

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?

objective-c xcode automatic-ref-counting
Is it possible to debug "Terminated due to memory error"?

In a certain (consistent) point when my app is running, I consistently get the xcode error message Terminated due to …

ios objective-c memory-management automatic-ref-counting
Weak and strong property setter attributes in Objective-C

What is the difference between weak and strong property setter attributes in Objective-C? @property(retain, [weak/strong]) __attribute__((NSObject)) CFDictionaryRef …

iphone ios objective-c automatic-ref-counting
capturing self strongly in this block is likely to lead to a retain cycle

How can I avoid this warning in xcode. Here is the code snippet: [player(AVPlayer object) addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(0.1, 100) queue:nil …

objective-c cocoa-touch automatic-ref-counting avplayer retain
ARC and bridged cast

With ARC, I can no longer cast CGColorRef to id. I learned that I need to do a bridged cast. …

objective-c automatic-ref-counting type-conversion clang
How do I avoid capturing self in blocks when implementing an API?

I have a working app and I'm working on converting it to ARC in Xcode 4.2. One of the pre-check warnings …

objective-c ios objective-c-blocks automatic-ref-counting
Semantic Issue: Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

I'm currently using the iOS 5 SDK trying to develop my app. I'm trying to make an NSString a property, and …

objective-c variables ios5 properties automatic-ref-counting
Why does Apple recommend to use dispatch_once for implementing the singleton pattern under ARC?

What's the exact reason for using dispatch_once in the shared instance accessor of a singleton under ARC? + (MyClass *)sharedInstance { // …

ios objective-c singleton automatic-ref-counting
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 …

objective-c xcode automatic-ref-counting
What is the difference between a weak reference and an unowned reference?

Swift has: Strong References Weak References Unowned References How is an unowned reference different from a weak reference? When is …

swift memory-management automatic-ref-counting weak-references dangling-pointer