When I run my app on a simulator or my phone the code compiles fine but when I go to archive it (to upload to the App Store) I get the "ambiguous use of subscript" error.
Int((results?.valueForKey("schoolYear")[0])! as! Int)
How can I fix this?
When I run my app on a simulator or my phone the code compiles fine but when I go to archive it (to upload to the App Store) I get the "ambiguous use of subscript" error.
Int((results?.valueForKey("schoolYear")[0])! as! Int)
How can I fix this?
try
if let myExpectedArray = results?["schoolYear"] as? [Int] where !myExpectedArray.isEmpty {
let myInt = myExpectedArray[0]
}
The compiler doesn't know which type the dictionary returns, that means ambiguous use of subscript