Changes between Version 4 and Version 5 of ObjectiveC/Classes
- Timestamp:
- 01/12/09 05:36:54 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ObjectiveC/Classes
v4 v5 1 1 2 2 3 = Haskell Objective-C FFI: Declaring Objective-C Classes = 3 = Haskell Objective-C FFI: Objective-C Classes = 4 5 == Using classes == 6 7 We might import ObjC classes like so: 8 {{{ 9 foreign import objc "@class UIView" o'UIView :: Class 10 }}} 11 ''Problem:''' We also need to introduce the class type `C'UIView`. So far, the FFI has no support for the import of types. 12 13 == Declaring classes == 4 14 5 15 One option might be something like … … 8 18 }}} 9 19 10 == Option 1: value definition==20 === Option 1: value definition === 11 21 12 22 The class definition value `myUIView` contains the details of the class definition. However, it is odd, because `C'UIView` should usually be the type of instances if of `UIView`. 13 23 14 == Option 2: incremental definition==24 === Option 2: incremental definition === 15 25 16 26 In addition to the `foreign export` declaring the class, the class is populated with methods in further `foreign export` declarations.
