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

Explain the difference between interfaces, delegates, and protocols in Objective-C

middle

A grandparent, parent and child problem

expert

Explain the use case when ARC won't help you to release memory (but GC will)

Bình luận

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

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