I have a very simple subclass of UIButton:
@interface MyButton : UIButton @end @implementation MyButton - (id) initWithCoder:(NSCoder *)decoder { if (!(self = [super initWithCoder:decoder])) return nil; NSLog(@"-[%@ initWithCoder:%@]", self, decoder); return self; } @end
In Interface Builder, I add a UIButton, set its button type to Rounded Rect and its class identifier MyButton .
At startup, I have the following log:
-[<MyButton: 0x5b23970; baseClass = UIButton; frame = (103 242; 114 37); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x5b23a90>> initWithCoder:<UINibDecoder: 0x6819200>]
but the button is no longer a round button.
It is observed both on iOS 3.2 and iOS 4.
Is this a mistake or am I missing something obvious?
Creating an instance of MyButton programmatically is not an acceptable answer, thanks.
0xced source share