Câu hỏi phỏng vấn Objective-C
Câu hỏi

What is the difference between ARC (automatic r...

Câu trả lời

The main differences between ARC (Automatic Reference Counting) and GC (Garbage Collection) in Objective-C are:

  • ARC is a compile-time feature that automatically inserts retain and release calls based on static code analysis, eliminating the need for manual memory management. GC is a run-time process that periodically collects and frees unused objects[1].

  • ARC has no runtime overhead, while GC requires a separate process to manage memory, which can introduce latency[1].

  • ARC is supported on Apple platforms starting from Xcode 4.2 (2011). GC was supported in Mac OS X v10.5 but has been deprecated in favor of ARC in more recent versions of macOS and iOS[1].

  • ARC and manual reference counting are not mutually exclusive - ARC can be disabled for individual files in ...

senior

senior

Gợi ý câu hỏi phỏng vấn

junior

What are blocks and how are they used?

middle

What's the difference between the atomic and nonatomic attributes?

middle

When would you use Categories over Inheritance and vice versa?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào