Any object instance that is loaded from a nib will get created using initWithCoder: because the nib contains serialized object, and when the nib is loaded, the instances is reconstituted from the object archive, meaning that instead of init:, initWithFrame:, initWithNibName:, or initWithLarryMoeAndCurley:, it will always use initWithCoder: to initialize the object.
Try putting your code in initWithCoder:, make sure to call super first, and return self.
|