Possible Duplicate:
JSONkit sorting issues
I have the following jSON
[
{
"Pending": 67,
"Past Due": 63,
"Invites": 0
},
{
"Reading Approval": 4,
"Schedule Approval": 16,
"Session Assignment": 1
},
{
"Reading Approval": 3,
"Schedule Approval": 20,
"Class Approval": 20,
"Module Approval": 2,
"Training Plan Review": 2,
"Job Confirmation": 1
}
]
When I assign the json string to a nsarray the values inside the dictionary gets sorted alphabetically.
NSArray *arr = [strResult JSONValue];
How can I keep the same order as the json string?
arr =
{
Invites = 0;
"Past Due" = 63;
Pending = 67;
},
{
"Reading Approval" = 4;
"Schedule Approval" = 16;
"Session Assignment" = 1;
},
{
"Class Approval" = 20;
"Job Confirmation" = 1;
"Module Approval" = 2;
"Reading Approval" = 3;
"Schedule Approval" = 20;
"Training Plan Review" = 2;
}
)
This is the table I want to display:
Group 1
Pending 67
Past Due 63
Invites 0
Group 2
Reading Approval 4
Schedule Approval 16
Session Assignment 1
Group 3
Reading Approval 3
Schedule Approval 20
Class Approval 20
Module Approval 2
Training Plan Review 2
Job Confirmation 1
Using standard JSON parsers, you will need to change your data.
Assuming it’s possible for you to change your JSON format.
How to access the data. Assuming you have the array of sections and know the section and row indexes.
If you want to iterate over all the data