I have an array that for the sake of the example can hold both Ints and Strings, so I'm calling it an array of AnyObjects.
If I have an array of Strings, and an array of Ints, how do I put those in with the existing array of AnyObjects? (To be clear I want it to be a one-level, flat array, not with nested arrays within the array or anything).
For example, this code produces an error:
var arr: [AnyObject] = []
let foo = ["one", "two"]
let bar = [1, 2]
arr += foo
The error being "Binary operator += cannot be applied to operands of type [String] and [AnyObject]".
What should I be doing here?