• 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
DOs and DOn'ts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DOs and DOn'ts


  • Subject: DOs and DOn'ts
  • From: Isaac Sherman <email@hidden>
  • Date: Mon, 25 Feb 2002 18:11:23 -0500

I am aware of the recent (and extensive) discussion of DO. However, I think
I'm missing something. I cannot seem to get a vended object no matter what
I do. I have a daemon and a small program that needs to be launched. It
launches the program, everything compiles without a hitch; but the proxy is
always null. In the server program, the relevant code is this:
NSConnection * openServer(id vendedObject)
{
NSConnection * theConnection=[NSConnection defaultConnection];
[theConnection setRootObject:vendedObject];
if([theConnection registerName:@"myServer"]==NO)
{
NSLog(@"Error registering connection! Terminating
abnormally!\n");
exit(255);
}
[theConnection runInNewThread];
return theConnection;
}

in the rest of the code, I use [[NSRunLoop
currentRunLoop]configureAsServer], and then, just after launching the
client, where the call comes, I have the current run loop run for 60
seconds.
Then, voila. null. My relevant code in the client is pretty basic:

id * theProxy = [[NSConnection
rootProxyForConnectionWithRegisteredName:@"myServer"
host:nil] retain];//I've used both
nil and @"*" to no avail
NSLog(@"the proxy is of class %@\n", [theProxy class]);
NSLog(@"The name of the vended object is %@\n", [theProxy getName]);/*the
vended object has a name, and responds to this method*/


Both NSLogs report (null), and I'm completely lost as to why. I've checked
the web on multiple tutorials/docs/etc., read and reread the manual. I must
be missing something terribly obvious.

Again, if this has already been solved and discussed, I apologize. Three
times. Once for wasting your time reading the email, again for not paying
closer attention, and finally for using everyone else's bandwidth.

Thanks in advance,
--
Isaac Sherman
MotaSoft Software
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: DOs and DOn'ts
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: NSWorkspaceRecycleOperation and auto-renaming items moved to Trash
  • Next by Date: Re: text-to-speech problems, or is it just me?
  • Previous by thread: Re: text-to-speech problems, or is it just me?
  • Next by thread: Re: DOs and DOn'ts
  • Index(es):
    • Date
    • Thread