创建UIImage的两种方法

1.

UIImage *img = [UIImage imageNamed:@"imageName"];

 

2.

NSString *imageFilePath = [[NSBundle mainBundle] pathForResource:@"100" ofType:@"jpg"];
NSData *imageData = [NSData dataWithContentsOfFile:imageFilePath];
UIImage *image = [UIImage imageWithData:imageData];

 

posted @ 2014-09-26 16:24  lear  阅读(487)  评论(0编辑  收藏  举报