@interface NSArray (SleepSort) - (void)sleepSortObjectsUsingBlock:(void (^)(id obj))block; @end @implementation NSArray (SleepSort) - (void)sleepSortObjectsUsingBlock:(void (^)(id obj))block { for (id obj in self) { NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:obj, @"obj", block, @"block", nil]; [self performSelector:@selector(_handleSleepSortItemWithInfo:) withObject:info afterDelay:[obj intValue]]; } } - (void)_handleSleepSortItemWithInfo:(NSDictionary *)info { id obj = [info objectForKey:@"obj"]; void (^block)(id obj) = [info objectForKey:@"block"]; block(obj); } @end To use: NSArray *items = [NSArray arrayWithObjects: [NSNumber numberWithInt:5], [NSNumber numberWithInt:3], [NSNumber numberWithInt:6], [NSNumber numberWithInt:3], [NSNumber numberWithInt:6], [NSNumber numberWithInt:3], [NSNumber numberWithInt:1], [NSNumber numberWithInt:4], [NSNumber numberWithInt:7], nil]; [items sleepSortObjectsUsingBlock:^(id obj) { NSLog(@"obj = %@", obj); }]; //objectc/6503