Open Simulacrotron opened 12 years ago
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
CGGradientRef CreateGradientRefWithColors(CGColorSpaceRef colorSpace, CGColorRef startColor, CGColorRef endColor)
signature in
CGGradientRef CreateGradientRefWithColors(CGColorSpaceRef colorSpace, UIColor* startColor, UIColor* endColor)
and implementing the function as follows:
CGGradientRef CreateGradientRefWithColors(CGColorSpaceRef colorSpace, UIColor* startColor, UIColor* endColor)
{
CGFloat colorStops[2] = {0.0, 1.0};
NSArray *colors =
[NSArray arrayWithObjects:(__bridge id)startColor.CGColor, (__bridge id) endColor.CGColor, nil];
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef) colors, colorStops);
return gradient;
}
(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; }