• 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
Getting an object across application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: NSTextView trackingArea problem
  • Next by Date: Using NSTableView without Nib files
  • Previous by thread: Re: NSTextView trackingArea problem
  • Next by thread: Using NSTableView without Nib files
  • Index(es):
    • Date
    • Thread