From 889aa21f6eeec8cba461d7a930c1d3cdfeb13eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=AB=E6=AC=BA=E5=B0=91=E5=B9=B4=E7=A9=B7?= Date: Wed, 28 Feb 2018 11:52:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AA=E7=94=A8po?= =?UTF-8?q?ds=E7=AE=A1=E7=90=86=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDBRCity.plist=E6=96=87=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BRPickerView/AddressPickerView/BRAddressPickerView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BRPickerView/AddressPickerView/BRAddressPickerView.m b/BRPickerView/AddressPickerView/BRAddressPickerView.m index 9faf2ec..af0de55 100755 --- a/BRPickerView/AddressPickerView/BRAddressPickerView.m +++ b/BRPickerView/AddressPickerView/BRAddressPickerView.m @@ -130,7 +130,8 @@ - (instancetype)initWithShowType:(BRAddressPickerMode)showType - (void)loadData { // 如果外部没有传入地区数据源,就使用本地的数据源 if (!self.dataSource || self.dataSource.count == 0) { - NSString *filePath = [[NSBundle mainBundle] pathForResource:@"BRCity.plist" ofType:nil]; + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSString *filePath = [bundle pathForResource:@"BRCity.plist" ofType:nil]; NSArray *dataSource = [NSArray arrayWithContentsOfFile:filePath]; if (!dataSource || dataSource.count == 0) { isDataSourceValid = NO;