NotificationCenter, NSConnection, distributed notifications
NotificationCenter, NSConnection, distributed notifications
- Subject: NotificationCenter, NSConnection, distributed notifications
- From: Cocoa Developer <email@hidden>
- Date: Mon, 22 Sep 2003 21:31:01 -0700
Hi,
I was wondering if anyone knew anything about what I am about to
describe.
I have a python program that has a c module which interfaces with
objective-C code. Yes, it can be done.
The purpose of this program is to interface with UIs built by third
parties and use distributed objects for messaging. With a defined
protocol, the UI is able to setup a NotificationCenter and hoped to
communicate with our python/c module/Objective-C app. While we have
tested our UI with two different objective-C test programs, we have yet
to get the Objective-C test app to communicate with the python/c
module/Objective-C app.
Currently, we have found that the following code does create a
TESTServer. In fact, if we try to run the other Objective-C program
which registers a TESTServer, we get the error "Error registering
PACEServer".
@interface MYTestServer : NSObject <aProtocol> {
}
@end
MYTestServer *server;
NSConnection *defaultConnection;
NSAutoreleasePool *pool;
server = [[MYTestServer alloc] init];
pool = [[NSAutoreleasePool alloc] init];
defaultConnection = [NSConnection defaultConnection];
[[NSNotificationCenter defaultCenter] addObserver:server
selector:@selector(connectionDidDie:)
name:NSConnectionDidDieNotification
object:nil];
[defaultConnection setRootObject:server];
if ([defaultConnection registerName:@"TESTServer"] == NO) {
NSLog(@"Error registering PACEServer");
}
However, the TestUI fails when it reaches the following line when the
python/c module/Objective-C app server is running. It works, with the
other non-python test program.
server = [[NSConnection
rootProxyForConnectionWithRegisteredName:@"TESTServer" host:nil]
retain];
Question:
1) has anyone ever got something like this to work?
2) is it even possible? -- so I can tell my boss and work from a backup
plan.
3) what am I doing wrong?
4) are you going to vote for the CA recall?
Thank you in advance,
Randy
_______________________________________________
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.