我已经把plist文件带到了图像数组中...在那个传递中,有五个图像,但是如何在视图中检索这些图像?
我的代码是:
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"];
NSArray *animalImages=[NSArray arrayWithContentsOfFile:path];
NSMutableArray *animal=[[NSMutableArray alloc]init];
for(int i=0;i<[animalImages count];i++)
{
UIImage *img=[animalImages objectAtIndex:i];
[animalphoto setImage:img];
NSLog(@"print:%@",i);
//NSString *name=[animalImages objectAtIndex:i];
[animal addObject:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png",img]]];
}
}