Objective c 如何从imageview中显示的plist文件中检索图像数组?
我已经在拍摄图像数组中拍摄了plist文件。。。在这个过程中,有五个图像,但是如何在视图中检索这些图像呢 我的代码是:Objective c 如何从imageview中显示的plist文件中检索图像数组?,objective-c,Objective C,我已经在拍摄图像数组中拍摄了plist文件。。。在这个过程中,有五个图像,但是如何在视图中检索这些图像呢 我的代码是: - (void)viewDidLoad { [super viewDidLoad]; NSString *path=[[NSBundle mainBundle] pathForResource:@"Animalfile" ofType:@"plist"]; NSArray *animalImages=[NSArray arrayWithContentsO
- (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]]];
}
}
-(void)viewDidLoad
{
[超级视图下载];
NSString*path=[[NSBundle mainBundle]pathForResource:@“Animalfile”类型:@“plist”];
NSArray*animalImages=[NSArray arrayWithContentsOfFile:path];
NSMutableArray*animal=[[NSMutableArray alloc]init];
对于(int i=0;i