to start, this is my code :
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL
URLWithString:url]];
NSData *response = [NSURLConnection sendSynchronousRequest:request
returningResponse:nil error:nil];
NSDictionary *publicTimeline = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError];
for (NSObject* key in publicTimeline) {
id value = [publicTimeline objectForKey:key];
NSLog(@"%@", key);
}
I take few news on a webservice, and i show it in a tableView.
My problem is that these news aren't show in order.
In my webservice, the news are in order, for example i have :
{"0":{"title":"News1"}}
{"1":{"title":"News2"}}
{"2":{"title":"News3"}}
etc..
but in the loop, i "loose" this order :/ And i want to have my news in this order, first the news with the index "0" after "1" etc...
(the NSDictionary seems to loose this order, for example, after my code, i have in my tableview, the news : "2", "0", "1", and not my news "0", "1", "2". )
(i tried some answers, but none seems to work in my case :( )
SOmeone to help me ? thx,