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

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -