當手機升級到iOS 13的時候,你會發現很多奇葩問題,比如:原來正常的項目現在報錯了,原來可以獲取到的Wi-Fi信息沒有了,定位彈框自動消失等等。
定位權限彈框彈出後沒有做任何操作自動消失了,代碼如下:
CLLocationManager *locationManagerSystem = [[CLLocationManager alloc]init];
[locationManagerSystem requestWhenInUseAuthorization];
修改後,將locationManagerSystem定義爲全局變量
{
CLLocationManager *locationManagerSystem;
}
locationManagerSystem = [[CLLocationManager alloc]init];
[locationManagerSystem requestWhenInUseAuthorization];