int n = 10;
NSMutableArray *numbers = [NSMutableArray array];
for (int i = 0; i <= n; i++) {
[numbers addObject:[NSNumber numberWithInt:i]];
}
NSMutableArray *result = [NSMutableArray array];
while ([numbers count] > 0) {
int r = arc4random() % [numbers count];
NSNumber *randomElement = [numbers objectAtIndex:r];
[result addObject:randomElement];
[numbers removeObjectAtIndex:r];
}
NSLog(@"%@", result);