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

middle

A grandparent, parent and child problem

expert

What's the difference between marking a method as @objc vs dynamic , when would you do one vs the
other?

expert

What is Dynamic Dispatch and how does it work 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