I have an ordered To Many relationship and Xcode 8 has generated an attribute of type NSOrderedSet with a bunch of helper functions to insert and remove elements.
Now I am trying to find an object and the Apple documentation indicates that the following function is available for NSOrderedSet:
func index(of object: Any) -> Int
func index(ofAccessibilityElement element: Any) -> Int
Autocompletion can and often is wrong. It can be handy but it's not a reference for what's correct.
I don't know what you mean about the compiler wanting to use that method, because it's not what you need to look up objects in an ordered set. The correct method would be
index(of:), as in
var myset = NSMutableOrderedSet(array: [1, 2, 3]) myset.index(of:2)