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

What is the difference between NSDictionary and NSMutableDictionary ?

Câu trả lời

Here is the difference between NSDictionary and NSMutableDictionary in Objective-C:

NSDictionary

  • NSDictionary is an immutable collection of key-value pairs.
  • The contents of an NSDictionary cannot be modified after it is created.
  • Adding, removing or changing values in an NSDictionary will result in a compile-time error.
  • NSDictionary is thread-safe and can be safely accessed from multiple threads.
  • NSDictionary is optimized for fast lookup of values by key.

NSMutableDictionary

  • NSMutableDictionary is a mutable subclass of NSDictionary.
  • The contents of an NSMutableDictionary can be modified after it is created.
    -...
middle

middle

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

junior

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

expert

What are limitations of NSDictionary ?

middle

What mechanisms does iOS provide to support multi-threading?

Bình luận

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

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