Ulrik. S
Ulrik. S

Reputation: 326

How do i nest an array inside my dictionary?

Got a little issue here, first time working with Array inside Dictionaries. This is not working: var level2Dictionary = [String : [array]]() i get error:

Reference to generic type Array requires arguments in <...>.

How should i call this?! All help appreciated.

Upvotes: 0

Views: 79

Answers (1)

Nirav D
Nirav D

Reputation: 72460

Change your declaration like this

level2Dictionary = [String : [AnyObject]]()

Note: You can change AnyObject with the type you want with your Array like String, Int, or might Dictionary what ever that you want.

Upvotes: 1

Related Questions