I am trying to use the below post code with dataTaskWithURL:completionHandler to ensure that my app is not jamming:
NSString *rawStr = [NSString stringWithFormat:@"comments=%@&commentsDate=%@&commentsTime=%@&title=%@&userName=%@&qasidaNumber=%@&theUserId=%@%@%@", textComments.text, lbDate.text, lbTime.text, self.lbTitle.text, self.lbUserName.text , self.lbQasidaId.text, toSaveLink, toSaveUser, myJpg];
NSData *data = [rawStr dataUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString:@"http://MyWebSite.com/InsertNotes.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:data];
NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);
My question is how to use the code with dataTaskWithURL:completionHandler