-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using ARC line 57 of DCRoundSwitchKnobLayer.m Crashes #10
Comments
I can confirm this issue. |
Are you using a branch for this issue? I haven’t been able to reproduce this. |
I don't remember, it was long time ago. However I solved it somehow. |
I can confirm this issue as well. It happens on device only, though - works perfectly on simulator! Any solutions yet? |
I can confirm this as well. Not sure what's going on here. |
Also for me and only on device (runs perfectly on simulator), I've resolved changing
signature in
and implementing the function as follows:
(changing method's invocation accordingly) not sure if is ok since I'm new to objective-c but seems to work at the moment... |
The above solution worked great!! |
Line 57 (CFArrayRef ColorsArray =...) crashes with ARC enabled. I'm not sure how to work around the issue. I know you have to make some modifications for C structs and ARC, but I don't know enough about C to make the changes. Anyone have a workaround?
CGGradientRef CreateGradientRefWithColors(CGColorSpaceRef colorSpace, CGColorRef startColor, CGColorRef endColor)
{
CGFloat colorStops[2] = {0.0, 1.0};
CGColorRef colors[] = {startColor, endColor};
CFArrayRef colorsArray = CFArrayCreate(NULL, (const void**)colors, sizeof(colors) / sizeof(CGColorRef), &kCFTypeArrayCallBacks);
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, colorsArray, colorStops);
CFRelease(colorsArray);
return gradient;
}
The text was updated successfully, but these errors were encountered: