2010-06-06 32 views
1

有没有人有这种情况发生的想法?appendBezierPathWithGlyph在[NSBezierPath currentPoint]中失败

GDB输出:

0 .. 8: kill, abort, objc_exception_throw etc. 
9: 0x00007fff87ea21f4 in +[NSException raise:format:]() 
10: 0x00007fff8694e9e2 in -[NSBezierPath currentPoint]() 
11: 0x00007fff869e3b3b in __NSAppendBezierPathWithGlyphs() 
12: 0x00007fff869e5baf in -[NSBezierPath appendBezierPathWithGlyphs:count:inFont:]() 
13: 0x00007fff869e2e2d in -[NSBezierPath appendBezierPathWithGlyph:inFont:]() 

回答

1

objc_exception_throw是抛出一个异常的函数。在这种情况下需要注意以下两点:控制台日志会识别异常本身,调用堆栈导致objc_exception_throw

在这种情况下,我可以猜出来自调用堆栈的异常:currentPoint将在路径没有当前点时抛出。这是由the documentation for the appendBezierPathWithGlyphs:count:inFont: method备份(以及for the method you're directly calling):

您必须设置路径的当前点(使用moveToPoint:方法或通过建立前的直线或曲线段)调用此方法之前。

+0

谢谢!就是这样:) – Schwitzgabel 2010-06-07 13:15:48