• 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
Re: DO question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DO question.


  • Subject: Re: DO question.
  • From: warren marco <email@hidden>
  • Date: Mon, 1 Apr 2002 14:57:53 -0700

On Monday, April 1, 2002, at 02:43 PM, Jonathan Wight wrote:

> On 04/01/2002 15:05, "Ondra Cada" <email@hidden> wrote:
>
>>
>> On Monday, April 1, 2002, at 09:36 , warren marco wrote:
>>
>>> I guess I was wrong in assuming byref by default.It must be bycopy.
>>
>> IIRC, it *is* byref, but property list classes were sent bycopy for
>> higher
>> effectivity.
>>
>> I can't find the appropriate documentation excerpt anymore though?!?
>
> Well that may explain the problem I'm seeing... My classes are laid out
> kinda like this:
>
> @interface CAttributes {
> NSMutableDictionary *mContainer;
> }
> @end
>
> @interface CDaemon {
> CAttributes *mAttributes;
> }
> - (CAttributes *) getAttributes;
>
> The CDaemon is being shared and the client is calling getAttributes and
> performing get/set operations upon the object. If I dump the attributes
> out
> on the client I see the changes I made but when I dump them out on the
> daemon I dont see them at all.
>
> So how do I fix this? I've changed the getAttributes to be byref and
> this
> didn't seem to do diddly.
>

Oh no..... well.. how is your server connection set up? proper send and
receive ports? or just a receive?( is that possible?)
Also..... try implementing a protocol. This could be your problem. On
the client side it doesn't know that its sending a byref return SEL.
Try this... cross your fingers.... create a file ServerProto.h

#import "CAttributes.h"
@protocol ServerProto{


}
- (byref CAttributes *) getAttributes;
@end

Now in your server def...

#import "ServerProto.h"
@interface CDaemon <ServerProto> {
CAttributes *mAttributes;
}
@end

And then in the implementation....

- (byref CAttributes *) getAttributes{ return mAttributes;};

Then include ServerProto protocol in the client code code....

Then do something like this:
#import "ServerProto.h"
theServer =[connection rootProxy];
[theServer retain];
if(theServer == nil) NSLog(@"No server object to communicate with");
[theServer setProtocolForProxy:@protocol(ServerProto)];//<----- Make
sure this is called

This way the client knows it's byref. I may be pulling at strings but
try it. You should be implementing a protocol anyways to save your butt
from sending bad messages.

Hope this works!!!!!!!!! good luck

cheers,
warren marco
_______________________________________________
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.

  • Follow-Ups:
    • Re: DO question.
      • From: Jonathan Wight <email@hidden>
References: 
 >Re: DO question. (From: Jonathan Wight <email@hidden>)

  • Prev by Date: Re: More re: Carbon Events vs Cocoa Events
  • Next by Date: Re: More re: Carbon Events vs Cocoa Events
  • Previous by thread: Re: DO question.
  • Next by thread: Re: DO question.
  • Index(es):
    • Date
    • Thread