Re: Sending a custom object over NSConnection using socket ports
Re: Sending a custom object over NSConnection using socket ports
- Subject: Re: Sending a custom object over NSConnection using socket ports
- From: email@hidden (Kris Rambish)
- Date: Thu, 20 Jul 2006 17:43:20 +0000
My guess would be that your custom object would have to be able to be compacted, and since it is custom NSConnection doesn't know how to do that. Does your custom object contain parts that are not Cocoa objects? Like int or char? It might work if all of the objects were Cocoa objects.
Whenever I need to send a larger object with NSConnection I always pack all of my data into an NSDictionary.
Hope that helps,
Kris
-------------- Original message --------------
From: "Bryan Bonczek" <email@hidden>
>
> Hello all,
>
> I have been experiencing some difficulties using NSConnection (using socket
> ports) to send a message to a vended object that takes a custom object as a
> parameter.
>
> For example, if I have the following method in my vended object:
>
> -(void)receiveMessage:(MyCustomObject*)myObject
>
> and then I try to send a message to it, I get an NSInternalConsistencyError
> saying that the object cannot be unpacked.
>
> However, if I change the method to:
>
> -(void)receiveMessage:(NSString*)stringObject
>
> and send an NSString, the NSString gets unpacked just fine.
>
>
> Has anyone else encountered this problem? Why does this work for Foundation
> objects and not my custom object? Is there a protocol that MyCustomObject needs
> to implement in order for this to work?
>
>
>
> Thanks,
>
> Bryan Bonczek
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden