DOs and DOn'ts
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.