Skip to content

Commit

Permalink
Fixed PYSearch.bundle resource file loading failed
Browse files Browse the repository at this point in the history
Fixed PYSearch.bundle resource file loading failed
  • Loading branch information
ko1o committed Jan 3, 2017
1 parent d3e8c57 commit 5feaadc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PYSearch/NSBundle+PYSearchExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

#import "NSBundle+PYSearchExtension.h"
#import "PYSearchViewController.h"

@implementation NSBundle (PYSearchExtension)

Expand All @@ -18,7 +19,7 @@ + (NSBundle *)py_searchBundle
searchBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"PYSearch" ofType:@"bundle"]];
// 如果使用pod导入,并且在Podfile中配置use_frameworks!则[NSBundle mainBundle] 加载不到PYSearch.framework中的PYSearch.bundle资源文件
if (searchBundle == nil) { // 为空说明资源文件在PYSearch.framework中
searchBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:self] pathForResource:@"PYSearch" ofType:@"bundle"]];
searchBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[PYSearchViewController class]] pathForResource:@"PYSearch" ofType:@"bundle"]];
}
}
return searchBundle;
Expand Down
Binary file not shown.

0 comments on commit 5feaadc

Please sign in to comment.