virtual Size tableCellSizeForIndex(TableView *table, unsigned int idx)
 {
     jsval ret;
     bool ok = callJSDelegate(table, idx, "tableCellSizeForIndex", ret);
     if (!ok) {
         ok = callJSDelegate(table, "cellSizeForTable", ret);
     }
     if (ok) {
         JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
         Size size;
         JSBool isSucceed = jsval_to_ccsize(cx, ret, &size);
         if (isSucceed) return size;
     }
     return Size::ZERO;
     
 }
 virtual Size tableCellSizeForIndex(TableView *table, ssize_t idx) override
 {
     jsval ret;
     bool ok = callJSDelegate(table, idx, "tableCellSizeForIndex", ret);
     if (!ok) 
     {
         ok = callJSDelegate(table, "cellSizeForTable", ret);
     }
     if (ok) 
     {
         JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET
         JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
         Size size;
         bool isSucceed = jsval_to_ccsize(cx, ret, &size);
         if (isSucceed) return size;
     }
     return Size::ZERO;
     
 }
 virtual ssize_t numberOfCellsInTableView(TableView *table) override
 {
     jsval ret;
     bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret);
     if (ok)
     {
         JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
         ssize_t count = 0;
         bool isSucceed = jsval_to_ssize(cx, ret, &count);
         if (isSucceed) return count;
     }
     return 0;
 }
 virtual unsigned int numberOfCellsInTableView(TableView *table)
 {
     jsval ret;
     bool ok = callJSDelegate(table, "numberOfCellsInTableView", ret);
     if (ok)
     {
         JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
         uint32_t count = 0;
         JSBool isSucceed = jsval_to_uint32(cx, ret, &count);
         if (isSucceed) return count;
     }
     return 0;
 }
 virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override
 {
     jsval ret;
     bool ok = callJSDelegate(table, idx, "tableCellAtIndex", ret);
     if (ok)
     {
         JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
         cocos2d::extension::TableViewCell* arg0;
         do {
             js_proxy_t *proxy;
             JSObject *tmpObj = JSVAL_TO_OBJECT(ret);
             proxy = jsb_get_js_proxy(tmpObj);
             arg0 = (cocos2d::extension::TableViewCell*)(proxy ? proxy->ptr : NULL);
             JSB_PRECONDITION2( arg0, cx, NULL, "Invalid Native Object");
         } while (0);
         return arg0;
     }
     return NULL;
 }
 virtual TableViewCell* tableCellAtIndex(TableView *table, ssize_t idx) override
 {
     JSContext* cx = ScriptingCore::getInstance()->getGlobalContext();
     JS::RootedValue ret(cx);
     bool ok = callJSDelegate(table, idx, "tableCellAtIndex", &ret);
     if (ok)
     {
         cocos2d::extension::TableViewCell* arg0;
         do {
             js_proxy_t *proxy;
             JS::RootedObject tmpObj(cx, ret.toObjectOrNull());
             proxy = jsb_get_js_proxy(tmpObj);
             arg0 = (cocos2d::extension::TableViewCell*)(proxy ? proxy->ptr : NULL);
             JSB_PRECONDITION2( arg0, cx, NULL, "Invalid Native Object");
         } while (0);
         return arg0;
     }
     return NULL;
 }
 virtual void tableCellWillRecycle(TableView* table, TableViewCell* cell) override
 {
     callJSDelegate(table, cell, "tableCellWillRecycle");
 }
 virtual void tableCellUnhighlight(TableView* table, TableViewCell* cell) override
 {
     callJSDelegate(table, cell, "tableCellUnhighlight");
 }
 virtual void tableCellTouched(TableView* table, TableViewCell* cell) override
 {
     callJSDelegate(table, cell, "tableCellTouched");
 }
 virtual void scrollViewDidZoom(ScrollView* view) override
 {
     callJSDelegate(view, "scrollViewDidZoom");
 }
 virtual void tableCellHighlight(TableView* table, TableViewCell* cell)
 {
     callJSDelegate(table, cell, "tableCellHighlight");
 }
 virtual void scrollViewDidScroll(ScrollView* view)
 {
     callJSDelegate(view, "scrollViewDidScroll");
 }