无法访问ios中给定路径的捆绑包

时间:2018-03-23 11:54:49

标签: ios frameworks bundle xcode9.2

无法访问ios中给定路径的捆绑包。代码如下:

NSBundle *bundle = [NSBundle bundleWithPath:@"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks"];
if (![bundle load]) {
   NSLog(@"Error"); // maybe throw an exception
} else {
   _supporter = [NSClassFromString(@"BCBatteryDevice") valueForKey:@"sharedInstance"];
   _handler = [[BCBatteryDeviceHandler alloc] init];
}

0 个答案:

没有答案