1

I have a subclass of UIButton (MUIButton : UIButton) i want to call method default like:

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];

How can i call it inside my subclass ?

Jakub
  • 13,712
  • 17
  • 82
  • 139
  • 3
    possible duplicate of [Subclass UIButton to add a property](http://stackoverflow.com/questions/5500327/subclass-uibutton-to-add-a-property) – Jakub Aug 01 '12 at 07:46

2 Answers2

2

I think UIButton is not meant for subclassing, it's a class cluster, meaning the type specified actually returns some private subclass of UIButton (which you can't directly subclass).

What is it you want to achieve with subclassing UIButton? Are you sure there is no other way of achieving that? Depending on the answer you can probably find a better solution to the problem at hand.

Henri Normak
  • 4,695
  • 2
  • 23
  • 33
1

inheritting UIButton is very unwise , you had better inherit UIControl(or UIView) , or you can use Category of UIButton

cloosen
  • 993
  • 7
  • 17