Revision [232]

This is an old revision of ObjectiveC made by JohnMcIntosh on 2008-10-17 21:22:47.


This is the third attempt at having an objective-C bridge in Squeak. Historically there is one written by Marcel Weiher, and Avi Brant
This plugin does work on the carbon os-x VM (3.18.x) which makes testing easier, however much of the iPhone specific features are
not available under OS-X.

The goal of this plugin was to have it coded entirely in slang and minimize the amount of code that is actually in the plugin. In general
only a handful of people actually build plugins, so the process of updating that code for fixes or enhancements is slow. If the majority
of the code is in Smalltalk then it's easier for anyone to submit a fix or enhancement to the MC server.

On the Smalltalk side a decision was made to use ProtoObject as the super class. This was a bit troublesome because it required
bringing down a large number of methods from Object to make an objective-c class/subclass to work. These methods include:

('printing' longPrintOn:limitedTo:indent: longPrintStringLimitedTo: printOn: printString printStringLimitedTo:)

('smalltalk methods' asExplorerString defaultLabelForInspector error: halt inspect inspectorClass instVarAt: isKindOf: isMorph isNumber isString primitiveFailed smalltalkClass)

An ObjectiveCObject object contains one instance variable externalAddress which is the address of the Objective-C object.
We note at shutdown time if quitting all instances and subinstances of ObjectiveCObject have their externalAddress to zero.
If the address is zero and an attempt is made to use it as a valid Objective C address then a walkback will occur.


Other methods implemented were:

('testing' ifNil: ifNil:ifNotNil: ifNotNil: ifNotNil:ifNil: isNil isObjectiveCObject)

Which check to see if the

('accessing' descriptionAsString externalAddress externalAddressPrivate externalAddress: objectiveCClass objectiveCHash objectiveCSuperClass)

There are 3 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki