code: function createObject (val, type, name) {
    if (!val || ref.isNull(val)) return null;
  
    var cache = objc.objc_getAssociatedObject(val, objc.objcStorageKey);
    if (!ref.isNull(cache)) return cache.readObject(0);
  
    var instance = (type == '@') ? new (require('./id'))(val)
                          : new (require('./class'))(val);
  
    // store this ID JS reference into the Obj-C internal associated object store
    var refn = ref.alloc('pointer');
    refn.writeObject(instance, 0);
    objc.objc_setAssociatedObject(val, objc.objcStorageKey, refn, 0);
  
    return instance;
  }
docs: Creates an ID or Class depending on the encoded type, stores and
  manages cache for classes as well, this also wraps objects to
  create the objc(sel) type interface in JS.
  
  @api private