ArrayUtil.mm 317 B

123456789101112131415
  1. //
  2. // ArrayUtil.mm
  3. //
  4. // Created by Giles Payne on 2020/02/09.
  5. //
  6. #import "ArrayUtil.h"
  7. NSMutableArray* createArrayWithSize(int size, NSObject* val) {
  8. NSMutableArray *array = [NSMutableArray arrayWithCapacity:size];
  9. for (int i = 0; i < size; i++){
  10. [array addObject:val];
  11. }
  12. return array;
  13. }