Hi,
I'm working on a project with CocosBuilder integration. Code connection from a CCBI file to a ruby class is OK.
The only problem is CCBReader cannot link variable from CCBI files to the ruby class: CCBReader: Couldn't find member variable: nodeCredit
The code that failed
class HomeLayer < Joybox::Core::Layer
attr_accessor :nodeCredit
# The below callback is OK
def didLoadFromCCB
load_audio
end
end
I suspect the problem comes from how CCBReader retrieve Ivar from another class: Ivar ivar = class_getInstanceVariable([target class],[memberVarAssignmentName UTF8String]);. Below is the suspected code:
if (memberVarAssignmentType)
{
id target = NULL;
if (memberVarAssignmentType == kCCBTargetTypeDocumentRoot) target = actionManager.rootNode;
else if (memberVarAssignmentType == kCCBTargetTypeOwner) target = owner;
if (target)
{
Ivar ivar = class_getInstanceVariable([target class],[memberVarAssignmentName UTF8String]);
NSLOG("class: %@", [target class]);
if (ivar)
{
object_setIvar(target,ivar,node);
}
else
{
NSLog(@"CCBReader: Couldn't find member variable: %@", memberVarAssignmentName);
}
}
}
Kindly help with this. Thanks!
Hi,
I'm working on a project with CocosBuilder integration. Code connection from a CCBI file to a ruby class is OK.
The only problem is CCBReader cannot link variable from CCBI files to the ruby class:
CCBReader: Couldn't find member variable: nodeCreditThe code that failed
I suspect the problem comes from how CCBReader retrieve Ivar from another class:
Ivar ivar = class_getInstanceVariable([target class],[memberVarAssignmentName UTF8String]);. Below is the suspected code:Kindly help with this. Thanks!