Change selectedIndex to NSInteger to work better with Swift Ints

NSUInteger ends up as UInt which needs to be converted to an Int to do math
with other Ints in Swift. Lots of properties like Array.count that should return
non-negative values also are of type Int, which makes them easier to work with.