Subclassing UIButton but can't access my properties

后端 未结 4 1868
夕颜
夕颜 2020-12-16 08:51

I\'ve created a sub class of UIButton:

//
//  DetailButton.h
#import 
#import 

@interface MyDetailButt         


        
4条回答
  •  失恋的感觉
    2020-12-16 09:22

    That exception is because the actual button that you are trying to get the annotation from is not of class MyDetailButton, it is a UIButton. Verify that you set the class in IB for that particular button. Select the button in IB and press ⌘4 to see its identity, change the Class Identity to MyDetailButton.

提交回复
热议问题