It was actually deprecated in 10.5 according to the header, and the
10.5 release notes explain:
Deprecated NSRunLoop API
The -configureAsServer method is deprecated in 10.5. It never did
anything, so there was never a point in calling it in Mac OS X.
Since time immemorial the implementation looked like this:
- (void)configureAsServer {
}
So any apparently beneficial effect of calling it was entirely
coincidental.
Chris Kane
Cocoa Frameworks, Apple
On Sep 30, 2009, at 7:23 AM, Nick Rogers wrote:
Hi,
When I use [[NSRunLoop currentRunLoop] configureAsServer]; after
creating a service using NSConnection, it works.
But -configureAsServer is declared as deprecated with no alternative
suggested.
I tried removing it and the code doesn't work.
server code snippet: (doesn't work)
MYMessageServer *server = self;// here "self" is in instance of
MyMessageServer class
NSConnection *defaultConnection;
[[NSNotificationCenter defaultCenter] addObserver:server
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:nil];
defaultConnection = [NSConnection
serviceConnectionWithName:@"MyCompanyName.MyProductName.serverFull"
rootObject:server];
[defaultConnection addRunLoop:[NSRunLoop currentRunLoop]];
// not doing [[NSRunLoop currentRunLoop] run]; here as its the main
thread.
Client code snippet:
server = [[NSConnection
rootProxyForConnectionWithRegisteredName
:@"MyCompanyName.MyProductName.serverFull" host:nil] retain];
server is nil after the above line is executed.
Where can I find a simple implementation?
Or what changes to make to the above code?
Thanks,
Nick
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/ckane%40apple.com
This email sent to [email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]