
Hi guys, I am making some iPhone graph thingy. Here is my problem. I have one view controller and inside it two views graphView and segmented control view. I first draw graph view, than segmented control one. I want to have the functionality that when I click on some of the segmented control’s buttons, I reload data and draw new graph.
Right now I am doing that inside – (void)segmentAction:(id)sender just by adding another view like [self addSubview: aGraphView]. The problem is that this view is now covering segmented control like this

The question is how to not to lose segmented control in this process? 🙂
If you are adding a new view, you should be sure to set the frame property to a position and width and height that will not cause it to be bigger than it should.
Like so:
At least it looks like your new view is bigger than it is supposed to be. Also, be sure to draw only within those bounds, adding things outside the range of your view can cause problems.