My iPad app is master-detail styled. The detail view contains a self-defined view (let’s call it board view), all contents in that view are drawn in drawRect(). When iPad rotates orientation, because detail view size is changed, it needs to redraw the whole board view. Everything works fine so far. But I noticed one problem that when iPad rotates orientation, my app always delay a couple of seconds before rotate the screen. I checked the Mail application, when iPad rotates, its screen rotates immediately.
I wonder how to debug such performance problem. Is that because the board view’s drawRect() performs too slow?
You find this out by running your application in instruments (Product–>Profile or cmd-I) and choosing the time profiler. When you rotate the device you should see a spike on CPU activity – instruments will tell you where this time is being spent.
It probably is drawRect, if you are redrawing the whole view and it is a complex drawing operation. However, it’s hard to assist further at this stage.