NSIndexPath unavailable in watchOS 2?

I'm migrating my WatchKit extension code from watchOS 1 to watchOS 2. I encounter these errors about NSIndexPath:

No known class method for selector 'indexPathForRow:inSection:'

Property 'row' not found on object of type 'NSIndexPath *'


Does it mean I can not use NSIndexPath in watchOS 2 code?

You can use NSIndexPath, but you cannot use that method. This method is defined in a category on NSIndexPath in UITableView.h, and that class isn't available on watchOS.

I see. But it is also used by NSFetchedResultsController which is available to use on watchOS as part of Core Data framework.

Check out NSIndexPath.h for other initializers you can use:


+ (instancetype)indexPathWithIndex:(NSUInteger)index;
+ (instancetype)indexPathWithIndexes:(const NSUInteger [])indexes length:(NSUInteger)length;
- (instancetype)initWithIndexes:(const NSUInteger [])indexes length:(NSUInteger)length NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithIndex:(NSUInteger)index;
NSIndexPath unavailable in watchOS 2?
 
 
Q