Krutarth Patel Krutarth Patel - 3 months ago 19
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
let newObject = arr[indexPath.section] as? [AnyObject] and then use your code as let newProductDic = newObject[indexPath.row]