Select to view content in your preferred language

AGSGDBFeatureServiceTable load in background thread

4639
11
03-28-2015 02:44 PM
SimonFox
Deactivated User

Hi folks,

I'm tearing my hair out trying to load a feature service table in a background thread, as below. This works fine on the main iOS thread. But in a background thread no network activity occurs. I confirmed using Charles proxy server.

Hard to understand why, as it appears to block the main thread. My app locks up while these calls are occurring. Have I missed something?


Thanks,
Simon

dispatch_queue_t backgroundLoadThread = dispatch_queue_create("com.xxx.loadservicethread", NULL);

dispatch_async(backgroundLoadThread, ^(void) {

     AGSGDBFeatureServiceTable* fst = [[AGSGDBFeatureServiceTable alloc]initWithServiceURL:url

                                                                                       credential:myCredentials

                                                                                 spatialReference:mapView.spatialReference];

...

0 Kudos
11 Replies
DiveshGoyal
Esri Regular Contributor

Yeah, instruments is not the easiest to use. I gives you a lot of information but sometime you just don't know how to put all of that information together into something actionable.

AGSGDBFeatureServiceTable, apart from making network requests to the feature service, create a local geodatabase in which to temporarily store the features. I suspect some of that work to create and initialize a local GDB is happening on the main thread. We'll have to look into that.

0 Kudos
SimonFox
Deactivated User

Hi Divesh,

Just checking in to see if there was any progress on this one?

Cheers
Simon

0 Kudos