Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

North Bronson

macrumors 6502
Original poster
Oct 31, 2007
395
1
San José
Suppose that I have a Custom View that I need to set up to display. The Custom View has about three or four subviews that I need to add. I'm still a little confused when I should be using drawRect or layoutSubviews to set up a customized view.

The documentation wasn't entirely helpful. Is there any good rule of thumb? I have noticed that some views that I have written do not display correctly if I set it up with layoutSubviews, so I add subviews to the Custom View with drawRect, and things work perfectly. I would rather not use these two with trial and error, so if someone can explain just a little more what is going on (and the difference) with these two methods, I would really appreciate the help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.