CGContextSetStrokeColorWithColor: invalid context 0x0.
1. Error name: CGContextSaveGState: invalid context 0x0. CGContextDrawPath: invalid context 0x0. And so on. I compiled with no errors or warnings until runtime when I printed a series of <’s on the console. Error> The information is shown below (error message)
1. Error name: CGContextSaveGState: invalid context 0x0. CGContextDrawPath: invalid context 0x0. And so on. I compiled with no errors or warnings until runtime when I printed a series of <’s on the console. Error> The information is shown below (error message)
The error message
The reason for this error is not doing something improper to layer in the view’s -drawrect: method such as UIBezierPath’s – (void)setFill; – (void)setStroke; Method UIColor – (void)setFill; – (void)setStroke; Methods, etc.
2. Solutions
(1). Encapsulate the operations on the View Layer layer separately into the -drawRect: method of a View class
(2). Do not call the related method, the official annotation is generally given, com+ click to view: Drawing the context)
Officially given limits -& GT; drawing context
Read More:
- How to Fix Invalid bound statement (not found) Error
- The registered version of ArcEngine can edit the data in SDE (How to Fix 0x80040356 Error)
- 1067 – Invalid default value for ‘sex‘1366 – Incorrect string value: ‘\xE6\x8A\x80\xE6\x9C\xAF…‘ f
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- How to Fix Session is not Connecting (How to Diagnose it)
- [-] handler failed to bind to x.x.x.x: Port troubleshooting
- How to Fix IDM has been Registered with a Fake Serial Number
- Apache Groovy——java.lang.NoSuchMethodError: x.x.x: method <init>()V not found
- How to Fix stack overflow error
- error: unclosed character literal (How to Fix)
- How to Fix The Latest Version of chrome cannot install the IDM plug-in IDMGCExt.crx
- Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded (How to Fix)
- Android resource compilation failed (How to Fix)
- How to Fix GIT Push Error
- How to Fix Error in module RSQL of the database interface
- How to Fix Your Timestep
- How to Fix Error: JavaFX cannot find fxml
- Error, some other host already uses address (How to Fix)
- Android Studio: Application Installation Failed (How to Fix)
- [Solved] emulator: glteximage2d: got err pre 🙁 0x502 internal 0x1908 format 0x1908 type 0x1401