PYSearch
PYSearch copied to clipboard
导入文件夹后无法获取bundle中的资源
导入文件夹后无法获取bundle中的资源,用cocoapods可以获取到
请参考下面的获取资源路径的方式
//Default use `[NSBundle mainBundle]`.
searchBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"PYSearch" ofType:@"bundle"]];
/**
If you use pod import and configure `use_frameworks` in Podfile, [NSBundle mainBundle] does not load the `PYSearch.fundle` resource file in `PYSearch.framework`.
*/
if (nil == searchBundle) { // Empty description resource file in `PYSearch.framework`.
searchBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[PYSearchViewController class]] pathForResource:@"PYSearch" ofType:@"bundle"]];
}