<分区>
Possible Duplicate:
How to display an array in reverse order in objective C
我有一个 NSMutableArray
,这个数组很好地包含了 UITableView
中的信息。
但我想首先在 UITableView
中显示最新信息。现在,最早的信息首先出现在 UITableView
中。我的代码如下:
NSMutableArray *entries = [NSMutableArray array];
[self parseFeed:doc.rootElement entries:entries];
for (RSSEntry *entry in entries) {
[allEntries insertObject:entry atIndex:0]; //insertIdx];
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationRight];
}
那我怎样才能反转NSMutableArray
中的信息呢?