I want to change my code of post data to url from NSURLConnection to NSURLSession
<p>It seems that every time I want to edit and update my app, Apple has changed something that blocks me from 'let me just edit that quickly and upload my new version'. They now have disabled the possibility to use NSURLConnection for the Watch. I have used this before for the Watch but it seems Apple now wants me to use NSURLSession and I just can't seem to figure out how it works. Here is my code, can someone please take a look and let me know how to adjust it so it will work with NSURLSession.</p>

<pre><code>- (void)someFunction:(NSString *)startTime {
    // Download the json file
    NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.domain.something"];
    NSURL *jsonFileUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://aurlwithparameter%@&amp;another%@", [prefs stringForKey:@"user_id"], startTime]];
    _starttedTime = startTime;
    // Create the request
    NSURLRequest *urlRequest = [[NSURLRequest alloc] initWithURL:jsonFileUrl];

    // Create the NSURLConnection
    [NSURLConnection connectionWithRequest:urlRequest delegate:self];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
    [self.delegate connectionTimedOutMakingTempBlock:true];
}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    // Initialize the data object
    _registeredUser = [[NSMutableData alloc] init];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    // Append the newly downloaded data
    [_registeredUser appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    // Create an array to store the locations

    // Parse the JSON that came in
    NSUserDefaults *prefs = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.domain.something"];

    [prefs setObject:_starttedTime forKey:@"temp_start_time"];

    // Ready to notify delegate that data is ready and pass back items
    if (self.delegate)
    {
        [self.delegate tempDidStart];
    }
}
</code></pre>

<p>}</p>