本文整理汇总了C++中PageView::getUserObject方法的典型用法代码示例。如果您正苦于以下问题:C++ PageView::getUserObject方法的具体用法?C++ PageView::getUserObject怎么用?C++ PageView::getUserObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageView
的用法示例。
在下文中一共展示了PageView::getUserObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pagevieweventselector
static int tolua_Cocos2dx_PageView_addEventListenerPageView00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"PageView",0,&tolua_err) ||
!toluafix_isfunction(tolua_S,2,"LUA_FUNCTION",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,3,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
PageView* self = (PageView*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addEventListenerPageView'", NULL);
#endif
LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create();
if (NULL == listener)
{
tolua_error(tolua_S,"LuaCocoStudioEventListener create fail\n", NULL);
return 0;
}
LUA_FUNCTION handler = ( toluafix_ref_function(tolua_S,2,0));
listener->setHandler(handler);
CCDictionary* dict = static_cast<CCDictionary*>(self->getUserObject());
if (NULL == dict)
{
dict = CCDictionary::create();
self->setUserObject(dict);
}
dict->setObject(listener, "pageViewEventListener");
self->addEventListenerPageView(listener, pagevieweventselector(LuaCocoStudioEventListener::eventCallbackFunc));
}
return 0;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'addEventListenerPageView'.",&tolua_err);
return 0;
#endif
}