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 is the difference between ARC (automatic reference counting) and GC (garbage collection)?

expert

Explain method swizzling. When you would use it?

senior

What happens when you invoke a method on a nil pointer?

Bình luận

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

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