【问题标题】:NSMutableIndexSet to NSMutableArray [duplicate]NSMutableIndexSet 到 NSMutableArray [重复]
【发布时间】:2015-01-11 13:48:26
【问题描述】:

我有 NSMutableIndexSet 和索引,我想用他的索引创建一个 NSArray..

NSMutableIndexSet *mutableIndexSet = [NSMutableIndexSet new];
[mutableIndexSet addIndex:0];
[mutableIndexSet addIndex:2];
[mutableIndexSet addIndex:4];

我该怎么做??

谢谢

【问题讨论】:

    标签: objective-c nsmutablearray nsindexset


    【解决方案1】:
    [mutableIndexSet enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
        [myMutableArray addObject:[NSNumber numberWithInteger:idx]];
    }];
    

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-20
      • 2011-11-07
      • 1970-01-01
      • 1970-01-01
      • 2013-04-20
      相关资源
      最近更新 更多