Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective-C: Avoiding EXCEPTIONS when NSConnection to Distributed Objects fail
    primarykey
    data
    text
    <p>I'm using Objective-C Distributed Objects (DO) to share data from one application (that collects data from the network) to another (a patch inside Quartz Composer). When the connection to the distant object fails (when I shut down the first application), I'm get:</p> <pre><code>5/16/12 8:17:06.373 PM Quartz Composer: *** EXCEPTION IGNORED: connection went invalid while waiting for a reply because a mach port died </code></pre> <p>After that point, the Quartz composition is hung. Even after I bring the first application back up, it's still hung. I want the Quartz patch to reconnect.</p> <p>I am using the Notification Center to put shut down the old objects, like this:</p> <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie) name:NSConnectionDidDieNotification object:theConnection]; </code></pre> <p>Right now, my counnectionDidDie looks like this:</p> <pre><code>- (void) connectionDidDie { NSLog(@"Connection died and we detected it"); [[self proxyObject] release]; [self setProxyObject:nil]; theConnection = nil; } </code></pre> <p>I also check to be sure the connection is still alive, just before accessing any part of the proxyObject, like this:</p> <pre><code>if ([NSConnection defaultConnection]) { // this line triggers the exception // access proxyObject } </code></pre> <p>I've also tried </p> <pre><code>if ([theConnection isValid]) { // this line triggers the exception // access proxyObject } </code></pre> <p>In both cases, it's this test that triggers this EXCEPTION.</p> <p>What can I do to prevent the hang of Quartz when I shutdown the first application, who has the vended object?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload