Memory Management & ARC
ARC, strong/weak/unowned, retain cycles, capture lists, memory leaks, profiling
1What is ARC (Automatic Reference Counting) in iOS?
What is ARC (Automatic Reference Counting) in iOS?
Respuesta
ARC is an automatic memory management mechanism that counts references to objects. The compiler automatically inserts retain and release calls, eliminating manual memory management. When the reference count reaches zero, the object is deallocated. ARC significantly simplifies iOS programming by preventing common memory leaks.
2What is a strong reference in ARC?
What is a strong reference in ARC?
Respuesta
A strong reference increments the reference counter of the referenced object. By default, all variables are strong references. The object remains in memory as long as at least one strong reference points to it. Using too many strong references can create retain cycles preventing deallocation.
3What is a retain cycle?
What is a retain cycle?
Respuesta
A retain cycle occurs when two or more objects hold strong references to each other. Neither can be deallocated because each prevents the other's reference count from reaching zero. This creates a memory leak. Retain cycles are prevented by using weak or unowned references in circular relationships.
What is the role of deinit in ARC memory management?
What is the difference between weak and unowned references?
+19 preguntas de entrevista
Otros temas de entrevista iOS
Swift Basics
Swift Language Essentials
UIKit Fundamentals
UIViewController Lifecycle
UserDefaults & Keychain
Application Lifecycle
Auto Layout & Constraints
UITableView & UICollectionView
SwiftUI Basics
SwiftUI State Management
SwiftUI Navigation
Networking & URLSession
Codable & JSON Parsing
Core Data
Protocol Oriented Programming
MVVM Architecture
Push Notifications
Unit Testing & XCTest
UI Testing
Xcode & Build System
Swift Package Manager
Combine Framework
Concurrency & async/await
iOS Design Patterns
Performance Optimization
Security & Encryption
SwiftUI Advanced
iOS Application Architecture
Domina iOS para tu próxima entrevista
Accede a todas las preguntas, flashcards, tests técnicos, ejercicios de code review y simuladores de entrevista.
Empieza gratis