[squeak-dev] Yet another Objective-C bridge

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Yet another Objective-C bridge

John M McIntosh-2
As part of my iPhone work I've built yet another Objective-C bridge.

It can be found within ftp://ftp.smalltalkconsulting.com/experimental/
The required Smalltalk code for the basic logic, the SUnits, and the  
Plugin generation can be loaded from http://www.squeaksource.com/ObjectiveCBridge2.html
The additional pieces required to build the plugin are found within  
the iSqueak SVN tree.  http://svn.isqueak.org/vm/

Using aregular 3.8.18b4U macintosh carbon VM with the ObjectiveCBridge  
installed means you can invoke.

testRetainCount
        | classOop instance1 count |

        classOop := ObjectiveCObject findClassName: 'NSObject'.
        instance1 := classOop new.
        count := instance1 retainCount.
        self should: [count = 1].
        instance1 retain.
        count := instance1 retainCount.
        self should: [count = 2].
        instance1 release.
        count := instance1 retainCount.
        self should: [count = 1].


People are welcome to confirm that it works, although it is compiled  
for ppc and i386 (32bit) I have not yet tested on ppc.

This plugin was also installed for the currently shipping iPhone VM  
1.05b3, however there seems to be a problem
where resolving the method signature object isEqualTo: for usage  
between two instances of NSObject returns nil.
But only on an ipod touch or iPhone not in the Simulator, or running  
as an os-x application.