Hi,
I am writing an iPhone application in Objective-C that utilizes some custom drawing in views and I would like to benchmark various revisions of my code to see what really helps. I was planing on doing this by setting up a new application, adding my custom drawing code to the drawRect: method of the view, then, in a for loop in the view controller, sending [UIView setNeedsDisplay]
some large number of times and timing how long it takes to complete. However the setNeedsDisplay
calls seem to be cached so even though I call it 1000 times in a for loop, the drawRect:
method gets called only once. Also, I tried calling drawRect: directly but I need a graphics context to do some drawing in and when I don't use setNeedsDisplay:
UIGraphicsGetCurrentContext() doesn't give me a context.
Any suggestions?
Thanks,
Kyle