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

expert

What was wrong with the NSEnumerator technique and why NSFastEnumeration was introduced?

middle

What are some limitations and problems you can face with categories?

senior

Explain the difference between interfaces, delegates, and protocols in Objective-C

Bình luận

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

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