gpt4 book ai didi

iphone - 请帮助调试 UILabel 上的崩溃 (evict_glyph_entry_from_cache)

转载 作者:搜寻专家 更新时间:2023-10-30 20:12:31 24 4
gpt4 key购买 nike

我在“UILabel”中遇到了一个奇怪的崩溃。崩溃是从 UILabel 或 CCLabelTTF 的 drawRect 发起的)。 (我已经花了很多时间在谷歌上搜索这个问题。)可能导致以下代码崩溃的原因是什么?

我正在使用 XCode SDK 4.0 和/或 4.1,cocos2d 版本 0.99.4、0.99.5

代码:

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(200,100,185,110)];
[label setTextAlignment:UITextAlignmentLeft];
[label setFont:[UIFont fontWithName:@"Marker Felt" size:14]];

[label setLineBreakMode:UILineBreakModeWordWrap];
[label setAdjustsFontSizeToFitWidth:YES];
[label setNumberOfLines:50];
label.text = message;
[label setBackgroundColor:[UIColor clearColor]];
[label setTextColor:[UIColor colorWithRed:0 green:81.0/255 blue:100.0/255 alpha:1]];

[self addSubview:label];
[label release]; label = nil;

崩溃:

Assertion failed: (cache->size >= g->size), function evict_glyph_entry_from_cache, file Fonts/CGFontCache.c, line 836.
Program received signal: “SIGABRT”.

#0 0x316b698c in __kill ()
#1 0x316b6982 in kill ()
#2 0x316b6974 in raise ()
#3 0x316cb620 in abort ()
#4 0x316b8f16 in __assert_rtn ()
#5 0x30f10d9e in evict_glyph_entry_from_cache ()
#6 0x30ed54e8 in expire_glyphs_nl ()
#7 0x30ed5494 in CGFontCacheUnlock ()
#8 0x30ed5008 in CGGlyphLockUnlock ()
#9 0x31e3a5e4 in ripc_RenderGlyphs ()
#10 0x31e42a66 in ripc_DrawGlyphs ()
#11 0x30ed0714 in CGContextDelegateDrawGlyphs ()
#12 0x30ed06c8 in draw_glyphs ()
#13 0x30ed025a in CGContextShowGlyphsWithAdvances ()
#14 0x311381f0 in WebCore::Font::drawGlyphs ()
#15 0x31137e42 in WebCore::Font::drawGlyphBuffer ()
#16 0x31137c76 in WebCore::Font::drawSimpleText ()
#17 0x31137ad2 in WebCore::Font::drawText ()
#18 0x31137a5e in drawAtPoint ()
#19 0x3117fdd4 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:measureOnly:] ()
#20 0x31180c50 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:] ()
#21 0x325ca46c in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:lineSpacing:includeEmoji:] ()
#22 0x325ca40a in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:lineSpacing:] ()
#23 0x325cb414 in -[UILabel _drawTextInRect:baselineCalculationOnly:] ()
#24 0x325cadf2 in -[UILabel drawTextInRect:] ()
#25 0x325cadaa in -[UILabel drawRect:] ()
#26 0x325c98e8 in -[UIView(CALayerDelegate) drawLayer:inContext:] ()
#27 0x30c6b308 in -[CALayer drawInContext:] ()
#28 0x30c6b190 in backing_callback ()
#29 0x30c6acb6 in CABackingStoreUpdate ()
#30 0x30c6a47e in -[CALayer _display] ()
#31 0x30c6a1ce in -[CALayer display] ()
#32 0x30c6a14a in CALayerDisplayIfNeeded ()
#33 0x30c6994a in CA::Context::commit_transaction ()
#34 0x30c696a8 in CA::Transaction::commit ()
#35 0x30c6f030 in CA::Transaction::observer_callback ()
#36 0x33519b56 in __CFRunLoopDoObservers ()
#37 0x33560a38 in CFRunLoopRunSpecific ()
#38 0x3356035c in CFRunLoopRunInMode ()
#39 0x30248b32 in GSEventRunModal ()
#40 0x30248bde in GSEventRun ()
#41 0x3259776e in -[UIApplication _run] ()
#42 0x32596472 in UIApplicationMain ()
#43 0x0000288e in main (argc=1, argv=0x2ffff618) at /Users/ahsan/Public/Drop Box/today1/main.m:13

最佳答案

我相信字体名称是 @"MarkerFelt-Thin"。试试看。

编辑:还有一个@"MarkerFelt-Wide"

关于iphone - 请帮助调试 UILabel 上的崩溃 (evict_glyph_entry_from_cache),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4378970/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com