How to Call drawRect programmatically in objective c ?
I want to call drawrect method of a view in my UItabbarcontroller. How i can do this ? Thanks in advance..
Edit
I have to call when the view is not visible currently. It will be the first time i have to call that view
[myView.layer display];
Forces the view to draw itself straight away.
[myView setNeedsDisplay: YES];
Forces the view to redraw on the next event loop cycle.
However, if you need to call it even when it is not visible, I think there is something wrong with the design of your view class. You should only be doing drawing inside drawRect: not anything else. And if you are only doing drawing why do it when the view is not visible?
setNeedsDisplay
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With