I have a UITextField with text: 9, 1, x, 1, 3, 3, y, 8
I need to remove all duplicates, remove all non-numeric characters and arrange the remaining numbers in ascending order.
So far I have:
-(IBAction)sortArrayPressed:(id)sender {
NSMutableArray *array = [[NSMutableArray alloc]init];
[array addObject:self.textToParseTextField.text];
NSLog([array description],nil);
}
The output reads:
Project[10176:2274463] (
"9, 1, x, 1, 3, 3, y, 8"
)
Am I correct using NSMUtableArray? How do we handle parsing and sorting this sort of array which has both types Int and String? Thanks!