Overwrite method inside an objective-c class as in Java -


i use statement extending class without needs of writing whole separate file. supposing classfromframework class being part of framework included in library.

public classfromframework {     public string mymethod() {       // operations    }     //lot of other methods....  } 

then in class following:

import com.framework.classfromframework;  public myclass {     public void method() {        classfromframework m = new classfromframework() {         @override         public string mymethod() {           // operations...         }       }         m.mymethod();    } } 

i wonder if can achieve same objective-c without declaring new combination .h .m files , import in using class.

you can make new subclass, , override methods, new classes must in own .h & .m files. that's how obj-c operates. in case, make sense have additional files.

you can call parent method word super. done time when subclassing viewcontroller, such in viewdidload.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -