IPhone iOS4.2 prevents MKMapView from initializing in another thread!

Due to a performance issue, I am trying to initialize my mapview in multithreaded mode. It works great in version iOS4.1 or lower. However, today some users send me emails that they receive with the card. and I got this message:

The application terminated due to the uncaught exception "NSRangeException", reason: "initWithFrame :: MKMapView must be initialized in the main thread".

I already changed the initialization of mapview to the main thread. However, do you guys know how to initialize a map in another thread using iOS 4.2?

Regards penny

+3
source share
1 answer

UIView . . , :

[myView performSelectorOnMainThread:@selector(makeSomethingFlashyHappen:)withObject:[NSNumber numberWithBool:YES] waitUntilDone:NO];
+4

Source: https://habr.com/ru/post/1776706/


All Articles