在framework内部获取framework里的bundle资源
NSBundle *bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"myBundle" ofType:@"bundle"]];
NSString *imagePath = [bundle pathForResource:@"icon@2x" ofType:@"png"];
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
将framework添加到项目里,在项目里获取framework里的bundle资源
NSString *frameworkPath = [[NSBundle mainBundle] pathForResource:@"Frameworks/MyFramework" ofType:@"framework"];
//得到对应的bundle路径
NSBundle *frameworkBundle = [NSBundle bundleWithPath:frameworkPath];
//得到资源的bundle路径
NSBundle *vivienBundle = [NSBundle bundleWithPath:[frameworkBundle pathForResource:@"myBundle" ofType:@"bundle"]];
NSString *pic1 = [vivienBundle pathForResource:@"icon@2x" ofType:@"png"];
UIImage *image = [UIImage imageWithContentsOfFile:pic1];