iphone - how to prevent usage of other init methods other than my custom method in objective-c -
iphone - how to prevent usage of other init methods other than my custom method in objective-c -
background - in iphone app have custom uitableviewcontroller - going pass required config extending existing "(id)initwithstyle:(uitableviewstyle)style" method extended custom one.
question - what's best way ensure user of custom controller class can phone call custom init method, , not initwithstyle or other init methods?
you can override init methods don't want used, , raise exception there.
you can override them , create them initialize designated initializer.
also, should specify on documentation.
iphone objective-c ios init initwithstyle
Comments
Post a Comment