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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -