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

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,704
6,296
I made a custom class that is a subclass of UIView and added it by adding a UIView in my xib file then changing its class to my custom class.

My custom class isn't being told initWithFrame:(CGRect)frame at any time, as the set up code I have in there isn't being called. Is there some other method I should use that will automatically be called when the xib is opened or should I just make my own set up method that my view controller calls?
 
When you add an existing class to a xib and change the class to your subclass, it calls initWithCoder, not initWithFrame. Implement that method and you should be fine.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.