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

entry

Name four important data types found in Objective-C

expert

What's the difference between marking a method as @objc vs dynamic , when would you do one vs the
other?

middle

What's the difference between the atomic and nonatomic attributes?

Bình luận

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

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