Which iOS classes that don't support zeroing weak references?
Is there a list of classes in iOS that can’t be referred with a
__weak pointer when using automatic reference counting (ARC)?
Apple’s Transitioning to ARC Release Notes only lists Mac classes so far:
Which classes don’t support zeroing-weak references?
You cannot currently create zeroing-weak references to instances of the following classes:
NSWindowController. In addition, in OS X no classes in the AV Foundation framework support weak references.
Is there a similar list for UIKit classes or even iOS-specific classes in general?
- iOS AdMob memory leak?
- UIPopovercontroller dealloc reached while popover is still visible
- Why does NSObject's “isMemberOfClass:class” specify __unsafe_unretained in XCode's autocompletion?
- Starting with Objective-C: To ARC or not to ARC?
- Weak self in closures and consequences example
- UIPageViewController crashes when flipped too fast during low memory
Solutions Collect From Internet About “Which iOS classes that don't support zeroing weak references?”
If you try to form a weak reference to an object that doesn’t support weak references, the program should die immediately. This is mentioned in the Objective-C Advancements in Depth video from WWDC 2011. So you should know immediately if you find a class that doesn’t support them.
I’m pretty sure the lack of mention in Transitioning to ARC Release Notes means that all
UIKit classes are safe. I’m not sure if the warning about
AV Foundation classes applies to iOS or not. I tested creating a weak reference to
AVCaptureSession on both iOS 5 and Lion and neither crashed. I tested creating a weak reference to an
NSWindow on Lion and it crashed with the message
cannot form weak reference to instance (0x102232ef0) of class NSWindow.
- UILabel text Issue in iphone
- unable to receive callback from second view controller
- How do I detect a touch over a specific area
- CATransition push without fade
- UIGraphicsGetImageFromCurrentImageContext() – Memory Leak
- Change Height of UISegmentedControl
- Get GPS without alert view with ROOT permission(jailbreak)
- Search multiple words in one string in swift
- Swift: Long Press Gesture Recognizer – Detect taps and Long Press
- Get currently typed word in UITextView
- Regular Expression for Password Validation Objective-C
- Multiple arguments in stringWithFormat: “n$” positional specifiers
- WebSockets on iOS
- Space between custom UITabBar and ViewController
- how to create spreadsheets for ipad?