I noticed in IOS5 when calling SetNeedsDisplayInRect for the first time, it causes the device to refresh the full-screen. this is different to previous IOS-Versions.
In the App I am working on I have an array of objects that needs to be drawn (mostly rectangles, with different line sizes). In case I want to redraw only a few rectangles I add the objects to an "Update"-Array and call SetNeedsDisplayInRect to invalidate the area of the rectangles.
inside my drawRect-Method I determine like this, to either draw the complete array of objects, or just the "Update-Array":
BOOL boolDrawFullScreen = CGRectEqualToRect(rect, self.frame);
if (boolDrawFullScreen)
//draw all the objects
else
//draw just the objects within the update-array
this worked perfectly until I tested it with IOS5. In fact it still works, but not the first time when calling SetNeedsDisplayInRect:--> CGRectEqualToRect returns always yes.
why is that?? what am I doing wrong?
any suggestions are highly appreciated!! Thanks
Tom