views:

36

answers:

2
moveMe[639] <Error>: CGContextSaveGState: invalid context
moveMe[639] <Error>: CGContextSetBlendMode: invalid context
moveMe[639] <Error>: CGContextSetAlpha: invalid context
moveMe[639] <Error>: CGContextTranslateCTM: invalid context
moveMe[639] <Error>: CGContextScaleCTM: invalid context
moveMe[639] <Error>: CGContextDrawImage: invalid context
moveMe[639] <Error>: CGContextRestoreGState: invalid context

Also, is 639 a line number in one of my class files? What does it refer to?

+3  A: 

I'm guessing your CoreGraphics context is invalid. Just a hunch.

I don't have a project open to check, but 639 is likely the process ID of your program.

Wade Williams
You're right, it's the process ID. I found it with ps ax.
awakeFromNib
+3  A: 

Basically this means you don't have a valid CGContextRef. This might be happening because you are drawing at a place where there isn't a context (outside of draw rect, or something similar). Check if UIGraphicsGetCurrentContext() is returning nil. If it is, you need to create a context to draw on. You can create an image context using UIGraphicsBeginImageContext\ UIGraphicsEndImageContext.

Elfred