I’ll try to make this as short as I can.
I wrote a custom class that extends UIView with a couple of IBOutlet properties, and it has a XIB associated with it where those IBOutlets are linked to.
I then want to take that class, embed it in some other XIB (for example, a table cell), and just have it work.
It seems that when I embed that custom class in the new XIB, it does not recognize the original XIB I associated with it, so it asks for me to reset the IBOutlets to interface elements on the new XIB. This is lame.
Does anyone understand what I am trying to do and have a good approach?
Here’s how I managed to make this work:
In Interface Builder
Open your outer nib and do this:
In Xcode
In your outer view controller’s viewDidLoad method, add these two lines:
If your outer nib is a custom UITableViewCell, put those lines in your awakeFromNib method instead.
Build & Run!