appendBezierPathWithGlyph在[NSBezierPath currentPoint]中失败 [英] appendBezierPathWithGlyph fails in [NSBezierPath currentPoint]
问题描述
有人在这种情况下会发生这种情况吗?
Has anybody an idea in which case this can happen?
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:] ()
推荐答案
objc_exception_throw
是引发异常的函数。在这种情况下,有两件事要看:控制台日志,它将标识异常本身,以及导致 objc_exception_throw
的调用堆栈。
objc_exception_throw
is the function to throw an exception. There are two things to look at in this circumstance: The Console log, which will identify the exception itself, and the call stack leading to objc_exception_throw
.
在这种情况下,我可以猜测单独来自调用堆栈的异常是什么:如果路径中没有当前点,则将抛出 currentPoint
。这由 appendBezierPathWithGlyphs:count:inFont:
方法(以及您直接调用的方法):
In this case, I can guess what the exception was from the call stack alone: currentPoint
will throw if the path has no current point. This is backed up by the documentation for the appendBezierPathWithGlyphs:count:inFont:
method (as well as for the method you're directly calling):
您必须设置路径的当前点(使用
moveToPoint:
方法或通过创建前一条直线或曲线段)在调用此方法之前。
You must set the path's current point (using the
moveToPoint:
method or through the creation of a preceding line or curve segment) before you invoke this method.
这篇关于appendBezierPathWithGlyph在[NSBezierPath currentPoint]中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!