Callbacks (sigh :-)

Davide Varvello d.varvello at quinary.com
Tue Feb 7 13:51:46 UTC 2006


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