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
Post a Comment