ios - Overriding designated initializer -


that you have a class subclass with a designated initiator when (eg, initWithNibName: Bundle: a subclass of UIViewController), and available If guests need to call to override its own designated initiator, Big Nerd Ranch book provide their own designated initiator and designated initiator of the superclass to call their own newly designated initiator. But what can you do if additional parameters are required?

Concretely, something like this:

  @interface MyViewController: UIViewController - (instancetype) initWithNibName: (NSString *) nibNameOrNil Bundle: (NSBundle *) nibBundleOrNil andDummyObj: (DummyObj *) Delegate with P: (ID & lt; DummyObjEditDelegate & gt;) Representative; @end  

I overriding super class representative my subclass is properly configured if it seems to be a nib file extracted from the archive? But if someone calls the named Superclassed Starter they will not be able to provide the representative, and I need that to be installed correctly.

Thank you.

Category "itemprop =" text ">

You should document the requirements of using the class, and if you need the parameters you need ( If they are not given an exception should throw always during the development which should always be picked up).


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -