Today, try AutoLayout and Storyboard/xib to do the UI, use or feel pretty handy, no longer worry about writing cumbersome UI code. Therefore, we also intend to use Xib to implement the custom control (UIView subclass), but in a small example of the process encountered a crash problem, the location of the crash occurs in [Super Initwithcoder:adecoder].
Looking at the call stack at the time of the crash, there are many initwithcoder: functions that feel like an infinite loop recursive call. Based on the answer to this article, it was discovered that you set the custom class of the view in Xib to Childview (the name of the custom control, inherited from UIView).
In fact, you only need to set the file's owner in Xib to Childview.
To implement a custom control with Xib, and to nest Xib in Xib, you can see this tutorial: IOS Interface Builder: Load another. xib file in the. xib file
Custom control appears [Super Initwithcoder:adecoder] crash problem resolution