views:

9

answers:

1

I have a view with buttons. This view sits in a tabbarcontroller. I have just gotten an issue which appears in the device, but not in simulator. If I switch to another tab and back again the view is redrawn and my buttons come out doubled. I know this because the borders are thicker and the buttons with variable text overwrite each other.

What could be the problem and how do I resolve it? My feeling is that it has to do with memory, but I have no idea how to debug the issue.

A: 

I doubt that is a memory issue. If you are not using Interface Builder to initialize the view make sure that you are not creating the view twice by an accident. Another possibility might be that the view gets rendered twice for an unknown reason. Try to break you app at the place of tab switching and check the view. There should only be one UIView (pointer).

Nick Brooks
drawRect is being called twice in a UIView. Now I have to figure out why.
John Smith