iOS图片优化加载本地图片

          UIImageView *imageV = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];;
            //低效
            imageV.image = [UIImage imageNamed:@"图片.png"];
            
            //高效
            NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
            NSString *filePath = [resourcePath stringByAppendingPathComponent:@"图片.png"];
            UIImage *image = [UIImage imageWithContentsOfFile:filePath];
            imageV.image = image;
            
            [self.view addSubview:imageV];

你可能感兴趣的:(iOS图片优化加载本地图片)