AppendBezierPathWithGlyph not working in [NSBezierPath currentPoint]

Does anyone have an idea in this case this could happen?

GDB Output:

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
source share
1 answer

objc_exception_throw is a function to throw exceptions. In this circumstance, there are two things: the console log, which identifies the exception itself, and the call stack leading to objc_exception_throw .

In this case, I can guess what exception was only from the call stack: currentPoint will currentPoint if there is no current point in the path. This is confirmed by the documentation for the appendBezierPathWithGlyphs:count:inFont: method (and also for the method that you directly call ):

Before calling this method, you must set the current waypoint (using the moveToPoint: method or by creating the previous line or curve segment).

+1
source

Source: https://habr.com/ru/post/886836/


All Articles