Krutarth Patel Krutarth Patel - 2 months ago 6x
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

let newObject = arr[indexPath.section] as? [AnyObject] and then use your code as let newProductDic = newObject[indexPath.row]