创建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];

 

你可能感兴趣的:(创建UIImage的两种方法)