[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[coco8] ObjectiveC block arguments

ObjectiveC blocks are similar to smalltalk blocks, but:
  1. are similar to normal objects, but are NOT true objects because canīt be instantiated in runtime (with objC's instantiation mechanism).
  2. are NOT stored in the heap (not managed by GC).
  3. are created at compilation time, by compiler machinery (internal layout can change from version to version of xcode).

The blocks are used by Apple frameworks and we are forced (in a few cases) to pass blocks as arguments.

There is no easy way to implement generic blocks nor cheap transform from s8 to objectiveC blocks.

Actually we support blocks implementing (by hand) the required interface to return a block calling a JSC functions implemented by the coco8 application. Most of the cases requiere by iOS SDK are implemented.

Uploaded Image: alert.gifWe have a sample call description in this page, where we show how to implement an enumeration block and how to pass the block to NSArray enumeration.

Draft papers and references on ObjectiveC blocks