获取bundle文件下的资源

NSBundle* bundle = [NSBundle bundleWithPath:[[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"bundleName"]];

    UIImage* img = [UIImage imageWithContentsOfFile:[bundle pathForResource:imageName ofType:@"png" inDirectory:[NSString stringWithFormat:@"文件名称%@",externPath]]];

posted on 2016-05-07 15:38  许鸣  阅读(572)  评论(0编辑  收藏  举报