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

What are the reasons for using NSOpe...

Câu trả lời

Here are the key reasons for using NSOperationQueue vs GCD (Grand Central Dispatch) and vice versa:

NSOperationQueue Advantages

  • Provides an object-oriented API that allows you to create and manage operations as first-class objects. This makes it easier to configure, prioritize, and manage dependencies between operations.

  • Allows you to cancel, suspend, and resume individual operations within the queue. With GCD, you can only cancel or suspend an entire queue.

  • Provides built-in support for operation dependencies, allowing you to specify that one operation must complete before another can start. GCD requires more manual coordination.

  • Supports operation priorities to control the order in which operations execute. GCD has no built-in priority support.

  • Provides a KVO-compliant API for monitoring the state of operations and queues. GCD has a lower-level C-based API.

GCD Advantages

  • **GCD is a lower-level, C-based A...
senior

senior

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

expert

What are limitations of NSDictionary ?

junior

What is a protocol, and how do you define your own and when is it used?

senior

What is the difference between NSMapTable vs NSDictionary ?

Bình luận

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

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