I\'m trying to use Coinbase\'s API to get information about my online bitcoin wallet, and I\'m trying to use Swift\'s NSURLSession object to do so. Perhaps I\'m missing some
In objective-C you can use __block and get the data when the operation finishes:
__block NSData *myData;
NSURLSession *session = [NSURLSession sharedSession];
[[session dataTaskWithURL:[NSURL URLWithString:urlString]
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error) {
myData = data;
}] resume];