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

What are limitatio...

Câu trả lời

Here are some key limitations of NSDictionary in Objective-C:

1. Key-Value Pairs

NSDictionary can only store key-value pairs. If you need to store more complex data structures, you may need to use other classes like NSArray or custom objects.

2. Immutable by Default

NSDictionary is immutable by default, meaning you cannot add, remove or modify keys or values after creation. If you need a mutable dictionary, you should use NSMutableDictionary instead.

3. Unordered

Dictionaries are unordered collections, so you cannot rely on the order of keys or values. If you need an ordered collection, use NSArray or NSOrderedSet.

4. Key Uniqueness

Each key in an NSDictionary must be unique. Attempting to add a duplicate key will replace the existing value.

5. Key and Value Types

Keys in an NSDictionary must be objects that conform...

expert

expert

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?

junior

What are blocks and how are they used?

Bình luận

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

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