Getting an object across application
Getting an object across application
- Subject: Getting an object across application
- From: rajesh swarnkar <email@hidden>
- Date: Thu, 26 Feb 2009 17:47:41 +0530
Hi All
I am not able to get the value of a NSString object across the applications.
Here are my sample code:
There are two application Server and PS1.
********************************Server.m*********************
- init
{
if ( self = [super init] )
{
//id remoteObjectProxyServer;
remoteObjectProxyServer = [[NSConnection
rootProxyForConnectionWithRegisteredName: @"PS1" host: nil] retain];
if (remoteObjectProxyServer)
[remoteObjectProxyServer performSelector: @selector(PS1Method1)];
}
return self;
}
- (void) awakeFromNib
{
[[NSConnection defaultConnection] setRootObject: self];
[[NSConnection defaultConnection] registerName: @"MyServer"];
}
-(void) SetValue:(inout NSString*) str
{
str = @"From Server";
}
*******************************************PS1.m******************************
- init
{
if ( self = [super init] )
{
remoteObjectProxy1 = [[NSConnection
rootProxyForConnectionWithRegisteredName: @"MyServer" host: nil] retain];
if (remoteObjectProxy1)
{
NSString* str = [[NSString alloc]init];
[remoteObjectProxy1 performSelector: @selector(SetValue:) withObject: str];
NSLog(str);
}
}
return self;
}
- (void) awakeFromNib
{
[[NSConnection defaultConnection] setRootObject: self];
[[NSConnection defaultConnection] registerName: @"PS1"];
}
Please help me
rks_mfs
_______________________________________________
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