I have a problem with this problem, I solved it using the MVC design pattern, I created a map class:
@interface Card : NSObject @property (strong,nonatomic) UIImage* img; @property (strong,nonatomic) NSString* url; @end
// then in the UIViewController in the DidLoad method:
// init Cards Card* card10= [[Card alloc]init]; card10.url=@"image.jpg"; card10.img = [UIImage imageNamed:[card10 url]];
//for example
UIImageView * myImageView = [[UIImageView alloc]initWithImage:card10.img]; [self.view addSubview:myImageView];
// you can check the image name so you can do this:
//eg
NSString * str = @"image.jpg"; if([str isEqualToString: [card10 url]]){
Hasan Sawaed Jun 02 '13 at 18:07 2013-06-02 18:07
source share