Why are my UIView layer properties not being set when called within initWIthCoder:(NSCoder *)aDecoder?
问题 I have a custom View class built which subclasses UIView. This view is loaded through a nib file in the ViewController via: [[NSBundle main] loadNibNamed:@"MyCustomView" owner:self options:nil]; Inside MyCustomView.h (which correctly hooked up in IB as the Main Views class) I have some subview properties linked: @interface MyCustomView : UIView <UITextFieldDelegate> { .... @public UIView *backgroundLayer; // a subview of the Main View inside the nib .... } @property (nonatomic, retain)