0

I have this array items

var items: [String] = []

And prizes[0] is __NSCFDictionary

And one of it key-value pair is

key: to_prizes

value:

Optional(<__NSCFArray 0x787dbfb0>(
94761178,
71959593,
36665808,
54185273,
18953944,
347,
790
)

How could I make the swift string array items to be [94761178,....,790]

1 Answer 1

2

You can access this path like this:

let prizesDictionary = prizes[0] as NSDictionary
let toPrizesArray = prizesDictionary["to_prizes"] as NSArray
var items: [String] = toPrizesArray as [AnyObject] as [String]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.