title: NSXPCConnection debugging interruption/invalidation
body: <p>I am on XCode 9, OSX not iOS, Objective-C.</p>
  
  <p>I have an XPC Service to talk to other applications.
  XPC Services are completely new to me. I've read documentation and articles i found - still i'd need some help. </p>
  
  <pre><code>// NSXPC Connection stored as ivar
  self.bridgeagent = [[NSXPCConnection alloc] initWithServiceName:@"com.myid.myapp.bridgeagent"];
  self.bridgeagent.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(bridgeagentProtocol)];
  self.bridgeagent.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(bridgeagentProxyProtocol)];
  self.bridgeagent.exportedObject = self;
  
  [self.bridgeagent setInvalidationHandler:^{
      NSLog(@"Bridgeagent invalidation handler!");
  }];
  
  [self.bridgeagent setInterruptionHandler:^{
      NSLog(@"Bridgeagent interruption handler!");
  }];
  
  [self.bridgeagent resume];
  </code></pre>
  
  <p>The Service is called like this:</p>
  
  <pre><code>// openFile method is listed in corresponding protocol
  [[self.bridgeagent remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
  NSLog(@"bridgeagent.openFile errorHandler: %@",error);
  }] openFile:parameters withReply:^(NSDictionary *returnParameters) { // do something with result }];
  </code></pre>
  
  <p>The call works and the service does its job. However - now that the service works i want to dig into making it more stable (even if i don't face any issues right now).</p>
  
  <p>Can someone explain to me </p>
  
  <ol>
  <li>the difference between interruption and invalidation (don't get it when one or the other happens)</li>
  <li>if there's a best practice to handle both cases</li>
  <li>how to force both cases (for debugging)</li>
  </ol>
  
  <p>Thank you for help</p>