I have loaded multiple datas into tableview
like below diagrams. I need to create button first click to show all the data's ascending order A
to Z.
like below figure (1)
----------------------------------
A 14 30
----------------------------------
z 20 10
----------------------------------
Button second click to show all the data decending order Z to A
. like below.
----------------------------------
Z 20 10
----------------------------------
A 14 30
----------------------------------
For some reason I have loaded multiple column values into separate NSMutableArray for tableview
.
NSDictionary *alertArray = [notificationdata objectForKey:@"response"];
NSArray *sortedKeys = [[alertArray allKeys]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
// Array_One
NSMutableArray *one = [[NSMutableArray alloc]init];
// Array_Two
NSMutableArray *two = [[NSMutableArray alloc]init];
for (keys in sortedKeys) {
[one addObject:[alertArray objectForKey:keys][@"name"]];
[two addObject:[alertArray objectForKey:keys][@"values"]];
}
- How to show descending order names?
- How to show total reverse order no's (second column)?