Returns the index, within a specified range, of an object compared with elements in the array using a given NSComparator block.
Original signature is '- (NSUInteger)indexOfObject:(id)obj inSortedRange:(NSRange)r options:(NSBinarySearchingOptions)opts usingComparator:(NSComparator)cmp'
Available in Mac OS X v10.6 and later.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public virtual NSUInteger IndexOfObjectInSortedRangeOptionsUsingComparator( Id obj, NSRange r, NSBinarySearchingOptions opts, Func<Id, Id, NSComparisonResult> cmp )
Public Overridable Function IndexOfObjectInSortedRangeOptionsUsingComparator ( _ obj As Id, _ r As NSRange, _ opts As NSBinarySearchingOptions, _ cmp As Func(Of Id, Id, NSComparisonResult) _ ) As NSUInteger
public: virtual NSUInteger IndexOfObjectInSortedRangeOptionsUsingComparator( Id^ obj, NSRange r, NSBinarySearchingOptions opts, Func<Id^, Id^, NSComparisonResult>^ cmp )
Parameters
- obj (Id)
- An object for which to search in the array.
- r (NSRange)
- The range within the array to search for obj.
- opts (NSBinarySearchingOptions)
- Options for the search. For possible values, see “NSBinarySearchingOptions.”
- cmp (Func<(Of <(<'Id, Id, NSComparisonResult>)>)>)
- A comparator block used to compare the object obj with elements in the array.
Return Value
If the NSBinarySearchingInsertionIndex option is not specified: If the NSBinarySearchingInsertionIndex option is specified, returns the index at which you should insert obj in order to maintain a sorted array:
Version Information
- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later)