I have the following problem. I'm writing my own class which must draw a circle of specified size, fill it with gradient.
I made it with a circle being a NSBezierPath, to which I draw my gradient using
[gradient drawInBezierPath:circle relativeCenterPosition:gradPoint]
So everything works great except one thing: when I execute the following command at the end of my drawRect: code:
[borderColor set];
[circle stroke];
I get the error: (Program recieved signal: "EXC_BAD_ACCESS") and debugger points to the line with
[borderColor set];
I set borderColor as
[NSColor colorWithCalibratedRed:0.8 green:0.8 blue:0.8 alpha:1.0]
for example.
It only works normally if i set my borderColor as any predefined color: blackColor, clearColor, greenColor. But any one which I try to set manually, crashes.
Does somebody know about any restrictions about colors or something that could cause such problem? I didn't find anything special about stroke color of BezierPath.
Thank you.