Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Distributed GUI



Hello,
I want to develop an application which GUI will consist of distributed objects.
I get unintended results - what am I doing wrong?


--------------------------------------- code snips:

***** client:
- (byref id) aquaView {
if (!aquaView) {
aquaView = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 20)];
[aquaView setStringValue:@"Distant view! Yupiii!"];
}
return aquaView;
}


***** server (where the view should appear):
      id target=[[NSConnection
   rootProxyForConnectionWithRegisteredName:toBeAddedName
                                       host:nil] retain];
      if (target==nil) {
         NSLog(@"Agent '%@' doesn't exist",toBeAddedName);
         return nil;
      }

// add new tab
NSTabViewItem* tab = [[NSTabViewItem alloc] initWithIdentifier:toBeAddedName];
[tab setLabel:toBeAddedName];
[view addTabViewItem:tab];


      // tab's view should be aquaView of the distant object
      id targetView = [target aquaView];
      NSLog(@"Target view: %@",targetView);
      NSLog(@"Target NSTextField value: %@",[targetView stringValue]);
      [tab setView:targetView];

---------------------------------------

When I run the client and the server, I get:

2007-09-30 10:11:13.151 LLDesk[4910] Target view: <NSTextField: 0x3193f0>
2007-09-30 10:11:13.151 LLDesk[4910] Target NSTextField value: Distant view! Yupiii!


So everything seems OK. But when I click on the newly created tab, the application simply hangs.

I suppose the whole thing has something to do with notifications and should be done somehow else, but I don't know how :(


Thanks for any advices, I'm totaly lost :(

M. Prymek

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.