我如何从GLuint中检索相应的纹理名称?

编辑5:优化级别构build设置:

构建设置

编辑4:我试图改变构buildconfiguration把所有“debugging”,然后运行“testing”。 奇怪的是,它没有崩溃大约20次(我不断装载和卸载各种GameScenes与不同的资产)。 在第二十一次(即使不是统计上相关的),我还以为它可能不会再崩溃了,但它已经崩溃了。 总结仍然不可用,所以我想知道如果我正确地做,或者如果有一些其他问题..这里是生成configuration和崩溃报告:

组态

还有什么事发生

编辑3:重要的是,这个错误只发生了一些时间,像6/7运行中的1,所以我觉得很难隔离它。

我有一些严重的麻烦理解哪些纹理获取此NSAssert失败。 我已经尝试了几种方法,但都没有工作(或者最有可能的只是我有点太愚蠢:))。

在debugging器中,我可以看到GLuint信息。 在互联网上阅读,我发现这是一种引用框架(一种指针)的方式。

我认为应该有办法从batchNode plist文件检索框架名称,并想知道如果这个GLuint数字可以以某种方式对应于plist文件中的帧的顺序。

NSAssert( !batchNode_ || texture.name == batchNode_.texture.name , @"CCSprite: Batched sprites should use the same texture as the batchnode"); /** texture name */ @property(nonatomic,readonly) GLuint name; 

我尝试了这些方法,但他们捕捉到所有情况:

 //From CCSprite.m -(void) setTexture:(CCTexture2D*)texture { if(!batchNode_ || texture.name != batchNode_.texture.name) { CCLOG(@""); // I added a debug here but it catches all cases.. NSAssert( !batchNode_ || texture.name == batchNode_.texture.name , @"CCSprite: Batched sprites should use the same texture as the batchnode"); } 

编辑:我知道是有点疯狂,但我粘贴我尝试初始化文件名​​在CCTexture2D,因为我似乎无法正确初始化它:

 - (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)hAlignment vAlignment:(CCVerticalTextAlignment) vAlignment lineBreakMode:(CCLineBreakMode)lineBreakMode font:(UIFont*)uifont { NSAssert( uifont, @"Invalid font"); fileName=string;//TODO: Remove ..... } 

上面的是我能修改的唯一的initWithString。 我不能修改另一个fileName属性:

 #elif defined(__CC_PLATFORM_MAC) - (id) initWithString:(NSString*)string dimensions:(CGSize)dimensions hAlignment:(CCTextAlignment)hAlignment vAlignment:(CCVerticalTextAlignment)vAlignment attributedString:(NSAttributedString*)stringWithAttributes 

编辑2:我试图分配fileName为:

 fileName = [string copy]; 

但它仍然给我不可用的报告在这里:

持续的问题

在animation更新期间,问题似乎在setTexture中发生,但fileName似乎本来是错误的。

这就是我在CCTexture2D中声明的属性:

 @property(nonatomic, copy) NSString* fileName; //TODO Remove