如何在ploco中显示plist图像
问题描述:
我正在开发使用目标c的mac桌面应用程序。我有一个图像数组显示一个接一个按钮按下时,所以我想用plist来存储图像名称,我想用plist在图像视图上显示图像。如何在ploco中显示plist图像
答
只需加载您的plist您保存您图像的路径数组是这样的:
NSString *myfile = [[NSBundle mainBundle]
pathForResource:@"images" ofType:@"plist"];
imagesArray = [[NSArray alloc] initWithContentsOfFile:myfile];
,然后当你要显示的图像,中庸之道得到它是从阵列路径之上,例如:
UIImage *img = [UIImage imageNamed: [imagesArray objectAtIndex:4]];
myImageView.image = img;