Krutarth Patel Krutarth Patel -4 years ago 193
iOS Question

Ambiguous Use of Subscript in Swift?

i am having data at indexpath at section.

when i try to retrive data it is working on simulator.

but when i test on device it gives error

"Ambiguous Use of Subscript in Swift"

here is my code

let newProductDic = arr[indexPath.section][indexPath.row]

please help me find out the issue what is correct syntax

Answer Source
let newObject = arr[indexPath.section] as? [AnyObject] and then use your code as let newProductDic = newObject[indexPath.row] 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download