I am getting an error on the Xcode console when running the following code:
// Create session
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];
// Create request
NSURL *url = [NSURL URLWithString:@"https://my.backend.com/endpoint"];
NSMutableURLRequest *mutableRequest = [NSMutableURLRequest requestWithURL:url];
mutableRequest.HTTPMethod = @"POST";
[mutableRequest setValue:@"text/plain" forHTTPHeaderField:@"Content-Type"];
NSData *postBody = [@"my_string_payload" dataUsingEncoding:NSUTF8StringEncoding];
[mutableRequest setHTTPBody:postBody];
// Create and initiate task
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:mutableRequest];
[dataTask resume];
The error I get is following:
... [Common] _BSMachError: port c11b; (os/kern) invalid capability (0x14) "Unable to insert COPY_SEND"
... [Common] _BSMachError: port c11b; (os/kern) invalid name (0xf) "Unable to deallocate send right"
The error is shown when running the resume
method. Everything seems to work fine though, there is no crash and the request works as expected.
I have looked for this error message and it is usually found related to 1) strange Xcode problems (such as this) or 2) UI elements lifecycle (such as here). These don't seem to apply to this case though.
I am using Xcode 8.3.3.