-(void)clickButtonAction{
if (self.textField.text.length<1) {
return;
}
NSMutableArray * arrayStr = [[NSMutableArray alloc]init];
for (int i = 0; i < self.textField.text.length; i++) {
unichar character = [self.textField.text characterAtIndex:i];
[arrayStr addObject:@(character - '0')];
// NSString *finalStr = [self.textField.text substringWithRange:NSMakeRange(i,1)];
// [arrayStr addObject:finalStr];
}
NSMutableArray * array = [NSMutableArray arrayWithArray:arrayStr];
for (int i = 0; i<array.count-1; i++) {
for (int j =0; j<array.count-1-i; j++) {
if ([array[j] intValue] > [array[j+1] intValue]) {
[array exchangeObjectAtIndex:j withObjectAtIndex:j + 1];
}
}
}
NSLog(@"从小大到大排序=%@",array);
}