Currently, I am attempting to draw a simple dot inside of a cell's UIImageView
's UIImage
. I am attempting to accomplish the same thing that the calendar application the iPhone has when an event is represented by a calendar.
[[event calendar] CGColor]
is an EKEvent
object which logs UIDeviceRGBColorSpace 0.509804 0.584314 0.686275 1
I attempt to create a small dot whose color is [[event calendar] CGColor]
. Heres what I am currently trying to do:
CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(contextRef, [[event calendar] CGColor]);
CGContextAddEllipseInRect(contextRef,(CGRectMake (12.f, 5.f, 4.f, 5.f)));
CGContextDrawPath(contextRef, kCGPathFill);
CGContextStrokePath(contextRef);
cell.imageViewPic.image = UIGraphicsGetImageFromCurrentImageContext();
But here are the errors I'm getting:
MYSCHEDULER[21445] <Error>: CGContextSetFillColorWithColor: invalid context 0x0
MYSCHEDULER[21445] <Error>: CGContextAddEllipseInRect: invalid context 0x0
MYSCHEDULER[21445] <Error>: CGContextDrawPath: invalid context 0x0
MYSCHEDULER[21445] <Error>: CGContextDrawPath: invalid context 0x0
I don't understand what I'm doing wrong... Why is the context invalid?