XPC connection interrupted
_BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid name (15)
Since XPC means OS X interprocess communication, so I think this can solve the problem,
dispatch_async(dispatch_get_main_queue(), ^{
// do what you want to do.
});