discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting running application


From: Chris B. Vetter
Subject: Re: Detecting running application
Date: Thu, 11 May 2006 17:05:18 +0200

On 5/11/06, Richard Frith-Macdonald <address@hidden> wrote:
[...]
1. Creates an NSMessagePort instance
2. calls [NSMessagePortNameServer-registerPort:forname:] useing the
newly created port and a unique identifier for the bundle
[...]

That is exactly what I was trying to do:

- (id) init
{
   id server = nil, port = nil;

   server = [NSMessagePortNameServer sharedInstance];
   port = [server portForName: @"Foobar"];

   if( ! port )
   {
     NSLog(@"no port, creating");
     port = [NSMessagePort port];
   }

   if( [server registerPort: port forName: @"Foobar"] )
   {
     NSLog(@"registered");
     return self;
   }
   return nil;
}

Both instances will tell me that there is no port, therefor create a
new one and register.

--
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]