• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Solved] NSRunLoop method - configureAsServer alternative in 10.6.1?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Solved] NSRunLoop method - configureAsServer alternative in 10.6.1?


  • Subject: Re: [Solved] NSRunLoop method - configureAsServer alternative in 10.6.1?
  • From: Nick Rogers <email@hidden>
  • Date: Wed, 30 Sep 2009 21:56:31 +0530

Hi,
Very basic error:
did [defaultConnection retain];
in server code.
Seems very basic but when I was doing - configureAsServer, it was working without retaining.


Thanks,
Nick

On 30-Sep-2009, at 7:53 PM, 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@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSRunLoop method - configureAsServer alternative in 10.6.1? (From: Nick Rogers <email@hidden>)

  • Prev by Date: Re: properties attributes misunderstanding
  • Next by Date: Deleting CalTasks through an Array.
  • Previous by thread: Re: NSRunLoop method - configureAsServer alternative in 10.6.1?
  • Next by thread: Dynamic NSArrayContent changing [was: NSTableColumn value binding]
  • Index(es):
    • Date
    • Thread