我有带有字典列表(item0,item1,item2)的列表的Plist ..通常当我在屏幕上显示时..它按升序填充... ..我item0 then item1 then item2......and so on
希望Plist以相反的顺序显示为itemn,itemn-1.........item2,item1,item0
.
这就是代码的运行方式...以及如何反转它..需要在Array
下面进行更改
NSMutableArray *Array=[NSMutableArray arrayWithArray:[self readFromPlist]];
NSMutableArray *items = [[NSMutableArray alloc] init];
for (int i = 0; i< [Array count]; i++)
//how to reverse by making changes here
//for (int i =[Array count] ; i>0; i--) does not work
{
id object = [Array objectAtIndex:i];
if ([object isKindOfClass:[NSDictionary class]])
{
NSDictionary *objDict = (NSDictionary *)object;
tempItemi =[[ECGraphItem alloc]init];
NSString *str=[objDict objectForKey:@"title"];
NSLog(@"str value%@",str);
float f=[str floatValue];
//my code here
}