Callbacks (sigh :-)

Davide Varvello d.varvello at quinary.com
Wed Feb 8 13:14:28 UTC 2006


Hi Alain,

It Works!!!!

There was two problems. First, the name of methods as you point me  
out, second the instantiation of the objective-c object i.e. I changed:
delegate _ (bundle classNamed:'TransferDelegate') new.
in
delegate _ (bundle classNamed:'TransferDelegate') new asObjcProxy async.

and the call:
MyObj new asObjcProxy async run.
in
MyObj run.


Anyway, thank you Alain again.
I'm attaching the squeak code below, next days I'll post also a  
minimal objective-c class to use with the squeak code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyCallbackableObj.st
Type: application/octet-stream
Size: 934 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060208/3246df82/MyCallbackableObj.obj
-------------- next part --------------

On 8 Feb 2006, at 09:28, Davide Varvello wrote:

> Hi Alain,
>  I'm happy to hear you.
>
> On 7 Feb 2006, at 21:21, Alain Fischer wrote:
>
>> Hi Davide,
>>
>> First, you must test that the Squeak callback process is running.
>> You could test that by running the tests in ObjcBridgeTest.
>> You must have: "16 run, 16 passed, 0 failed, 0 errors".
>>
>
> All passed.
>
>> But I don't think this is the cause of your problem.
>>
>> Has I read your exemple, "[aSqueakObject description];" will not  
>> write anything in the Transcript
>> because "description" is a NSObject message and is sent at the  
>> Objective-C SqueakProxy and not
>> forwarded to Squeak.
>>
>
> No, really!!!!! I'm unlucky
>
>
>> Try to:
>> - rename MyObj>>description as MyObj>>myDescription
>> - in printSomethingTo: send: "[aSqueakObject myDescription];"
>>
>
> I'll try and feedback you.
> Thanks a lot.
> Davide
>
>> Hope this will help you.
>> Alain
>>
>>
>> Le 7 f?vr. 06, ? 14:51, Davide Varvello a ?crit :
>>
>>> Hi All,
>>>  I need again some help from you. The context is always squeak/ 
>>> bluetooth/objective-c, but now I'm trying to reduce the scope to  
>>> better understand how things are working. So, as probably my  
>>> problems are coming from asynchronous communication between  
>>> squeak and objective-c, now I include below two snippets of code:
>>>
>>>
>>> Squeak object with two methods
>>>
>>> MyObj >> run
>>> | bundle delegate |
>>> bundle _ NSBundle bundleWithPath:'/Users/davide/TransferDelegate/ 
>>> build/TransferDelegate.framework'.
>>> bundle load.
>>>
>>> delegate _ (bundle classNamed:'TransferDelegate') new.
>>> delegate printSomethingTo:self.
>>>
>>>
>>> MyObj >> description
>>> Transcript show:'someone called me'.
>>>
>>> ----------------
>>>
>>> Objective-c file named TransferDelegate.m
>>>
>>>
>>>
>>> #import "TransferDelegate.h"
>>>
>>>
>>> @implementation TransferDelegate
>>>
>>>
>>> - (void) printSomethingTo: (NSObject *) aSqueakObject
>>> {
>>> 	[aSqueakObject description];
>>> }
>>>
>>>
>>> @end
>>> -------------------
>>>
>>> Ok, now from squeak I evaluate:
>>> MyObj new asObjcProxy async run.
>>>
>>> and I expect "someone called me" on Transcript, but unfortunately  
>>> nothing appears.
>>> I know the method printSomethingTo is called because I added some  
>>> code to it that prints a string on a file.
>>> Can you help me to solve this enigma :-) ?
>>> Thanks
>>>  Davide
>>>
>>
>>
>
>



More information about the Squeak-dev mailing list