If I set an object, say a view controller to nil, will its properties like buttons and labels also get released under ARC? What happens in case the properties are of type strong and assign? Also, when not using ARC, in my delloc method, do I only release retain type properties?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
You should read this Apple Memory Management documentation.
Basically, it depends. The view controller would be released unless some other instance was retaining it. Then, when it is released, its properties would be released - unless some other instance was retaining them.
Other instance could be retaining these references if you pass the objects referenced by those properties to another instance, or (if the property is some kind of
UIView
) you add them as a subview (then the view you add them to will retain them).The important thing is that if you're the owner you release the reference and if you need something you're passed, retain it and release it when you're done.