I am preparing my iPhone application to publish it in iOS 5 GM and stumbled upon an error with UIView. When I override the drawRect method in a subclass, the simulator shows the desired result, but when I try to test on the device itself, overriding drawRect has no effect whatsoever.
I even placed the registration operator in the override of drawRect and confirmed that it was being called.
Has anyone else noticed this problem?
The override code is used here:
- (void)drawRect:(CGRect)rect { DebugLog( @"*** calling drawRect ***" ); CGContextRef context = UIGraphicsGetCurrentContext();
}
Here is the code for generating color
+(const CGFloat*) getDarkGray { UIColor *color = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1]; return [self getCGColor:color]; } +(const CGFloat*) getCGColor: (UIColor*)color { CGColorRef colorref = [color CGColor]; const CGFloat *components = CGColorGetComponents(colorref); return components; }
Again, this code works fine in iOS 4.x and in Simulator for iOS 5. The only place that is broken is the iOS 5 device.
source share