objective c - Cocoa NSIndexSet : Multiple Indexes. How to create the index set, multiple indexes? -
i trying figure out how create set of indexes of lets (1, 2, 3) use in
- (void)selectrowindexes:(nsindexset *)indexes byextendingselection:(bool)extend
it's (nsindexset *)indexes
not know how use / create / populate indexes 1, 2, 3. should use class method or instance method?
i tried whole bunch of ways have no idea i'm doing ...
if indexes consecutive in example, can use this:
nsindexset *indexset = [nsindexset indexsetwithindexesinrange:nsmakerange(1, 3)];
if not, create mutable index set , add indexes (or ranges) 1 one:
nsmutableindexset *indexset = [nsmutableindexset indexset]; [indexset addindex:3]; [indexset addindex:5]; [indexset addindex:8];
Comments
Post a Comment