pathForResource returns 全部为零 pods
pathForResource returns nil for all pods
我升级到 xcode 8 并安装了 pod,现在所有依赖其自身资产的 pods 都无法找到包路径。像这样的代码全部 pods
self.assetBundle = [NSBundle bundleForClass:[self class]];
NSString *bundlePath = [self.assetBundle pathForResource:@"some_Pod_name" ofType:@"bundle"];
Bundle path returns nil 那么显然我的应用程序在 pod 中崩溃了。
assetBundle returns 这个
po self.assetBundle
NSBundle </Users/user1/Library/Developer/CoreSimulator/Devices/F0ACF195-A1C8-4DA6-96B5-9F9824DF/data/Containers/Bundle/Application/6F11AC53-0D13-4CD8-9DB0-77BE8C54C9/myapp.app> (loaded)
设置中一定有我无法理解的地方。我怎样才能解决这个问题 ?
我想通了。我需要为 pods 资源取消选中 "Run script only when installing"。
我升级到 xcode 8 并安装了 pod,现在所有依赖其自身资产的 pods 都无法找到包路径。像这样的代码全部 pods
self.assetBundle = [NSBundle bundleForClass:[self class]];
NSString *bundlePath = [self.assetBundle pathForResource:@"some_Pod_name" ofType:@"bundle"];
Bundle path returns nil 那么显然我的应用程序在 pod 中崩溃了。 assetBundle returns 这个
po self.assetBundle
NSBundle </Users/user1/Library/Developer/CoreSimulator/Devices/F0ACF195-A1C8-4DA6-96B5-9F9824DF/data/Containers/Bundle/Application/6F11AC53-0D13-4CD8-9DB0-77BE8C54C9/myapp.app> (loaded)
设置中一定有我无法理解的地方。我怎样才能解决这个问题 ?
我想通了。我需要为 pods 资源取消选中 "Run script only when installing"。