Solve the problem that the iOS 13 location permission popup automatically disappears

When the phone is upgraded to iOS 13, you will find many strange problems, such as: the original normal project is now reporting an error, the original Wi-Fi information that can be obtained is gone, the positioning box automatically disappears and so on.

After the positioning permission pop-up box pops up without any operation, it automatically disappears, the code is as follows:

CLLocationManager *locationManagerSystem = [[CLLocationManager alloc]init];
[locationManagerSystem requestWhenInUseAuthorization];

After modification, define locationManagerSystem as a global variable

{
    CLLocationManager *locationManagerSystem;
}
locationManagerSystem = [[CLLocationManager alloc]init];
[locationManagerSystem requestWhenInUseAuthorization];

Organize 45 e-books

Guess you like

Origin blog.csdn.net/qq_36478920/article/details/102500681