ios - Why does my NSURLSession dataTask make multiple calls to the server? -
i have nsurlsession datatask created using following method:
nsurlsessionconfiguration *defaultconfigobject = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *defaultsession = [nsurlsession sessionwithconfiguration: defaultconfigobject delegate:hvc delegatequeue: [nsoperationqueue mainqueue]]; nsurlsessiondatatask * datatask = [defaultsession datataskwithurl:url ]; [datatask setaccessibilitylabel:@"userprofiling"]; [datatask resume];
here, hvc viewcontroller handling delegate server data task call.
i see datatask making multiple calls server continuously.
is there way ensure 1 call made?
this has been solved , answered below.
i answering own question here.
by mistake, writing above code in method being called repeatedly. corelocation framework continuously updating user's location.
Comments
Post a Comment