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

senior

What are the differences between implementing a @property with @dynamic or @synthesize ?

expert

What sending a message to nil means and how is it actually useful?

expert

What are limitations of NSDictionary ?

Bình luận

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

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