Questions tagged [nsurlsessiondatatask]

See Apple documentation for Swift (URLSessionDataTask) and Objective C.

265 questions
1
vote
0 answers

iOS google reverse geocode not working properly

For reverse geocoding am using the following method, [api getRequest:[NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&key=%@&language=%@",latV,lonV,kGoogleAPIKey,@"en"] withCompletionHandle:^(NSData *data)…
1
vote
1 answer

Nested NSURLSessionDataTask for two consecutive HTTP GETs

I am a beginner in Objective C and I am looking to do two consecutive HTTP GETs (one after the other). What I have got so far is that I have a NSURLSessionDataTask inside the completion block of the first NSURLSessionDataTask. This is causing my…
Tywin
  • 21
  • 2
1
vote
2 answers

Post Request using Nsurlsession Cache response

When i try to call post request using nsurlsession cannot able to cache the response.Please help me out. Thanks in advance
1
vote
1 answer

iOS Swift fastest way to download many small files

I'm writing an iPad app that needs, to download many, but fairly small, .json and .jpg files from an server. So fare I am doing it like this: ///Function to allow for recursive calls to syncronize inspections sequentially. func…
Bjqn
  • 146
  • 2
  • 19
1
vote
2 answers

Moving from NSURLConnection to NSURLSession for SOAP POST in Swift

I am trying to move over from NSURLConnection over to NSURLSession for a SOAP post, but seem to have issues with the NSURLSessionDataDelegate. Here is the old code in NSURLConnection that works fine: let soapMessage = "
Dave
  • 351
  • 4
  • 18
1
vote
0 answers

Continue NSURLSession Data Task when app enters background

I have an application that retrieves JSON data from my server and enters it in to my Core Data model. I have this working reasonably well, minus a few issues with random EXC_BAD_ACCESS errors that I haven't figured out yet. During this dataTask,…
Sawyer05
  • 1,604
  • 2
  • 22
  • 37
1
vote
2 answers

nsurlsessiondatatask returns nil while sending a post request to REST based url ios

-(void)showData { NSError *error; NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration delegate:self…
1
vote
1 answer

Buggy and Slow scrolling when loading TableView images from CoreData

Problem : The process of loading images to Table View using their Paths that who stored in Core Data DB works fine , but the user experience not going well. The scroll is slow and buggy. Importants Notes : For my local DB i use Core Data Im not…
1
vote
2 answers

Updating Data vs Updating UI Dilemma

I have recently developed an iOS application with Swift which handles lots of background HTTP tasks and updates not only UI, but also static data for current session (lots of arrays, variables, etc) according to response data. I may be counted as…
natuslaedo
  • 429
  • 7
  • 16
1
vote
1 answer

NSURLSession with a performSelector:

I found out that iOS can run processes even when your application is in background mode (minimized) in at most 10 minutes, and to work around that and make it run forever, it would be necessary: Apps that need to download and process new content…
LettersBa
  • 747
  • 1
  • 8
  • 27
1
vote
1 answer

IOS sending jsonArray as POST data

Hi I am developing small IOS application in which I want to send json array as post data. I tried it in following manner : NSString *sampleParam = @"[{\"user:\"\"me Nilesh \"}]"; NSURLSessionConfiguration *defaultConfigObject =…
nilkash
  • 7,408
  • 32
  • 99
  • 176
1
vote
1 answer

session.dataTaskWithURL is not executing in proper sequence

I am calling Web service. In that method session.dataTaskWithURL is calling after some time.I think it is not giving in proper thread? my code below ——-------------- func callService(usr: String, pwdCode: String) ->Bool { var resultPage=false let…
dhaval shah
  • 4,499
  • 10
  • 29
  • 42
0
votes
0 answers

URL Session Data Structure

I am building iOS app where I insert an input string and search this string using Google , then I get the data string back and use it to search for specific word or series of characters I use URLSessionDataTask to do this let baseURL =…
0
votes
0 answers

How do I reduce lag when loading image with URLSession?

There is a lag in loading the UIImageView called profilePic. How can I get rid of this lag? The problem seems to be in my addImage() method. private func addImage() { let donorId = donor.lastName guard let urlString =…
0
votes
1 answer

Cannot convert return expression of type 'AnyPublisher in Combine

I am new to combine . I created an generic function which return AnyPublisher with result (T) and Error(Service error) it the custom error message . I have the pass the urlSession with dataTaskPublisher and return the request. I am getting following…
user8705895