objective c - Call Superclass method -


In Objective-C, how do I call the object's super class method?

For example, say I have an example of an object "foo".

There is a method in "foo" which is override. I do not want to call this overriden method. Instead, I want to call the original method at the foo object instance.

You can not do this:

[[Instance Super] super_math]; So far as I know how can I go about doing this?

I know that I can add a method for foo:

  - (zero) calls on {{super super_method]; }   

and more:

[foo calluper];

Any other ways? I really do not want to make any way to do this.

keyword super This does it for you most commonly it is - Init is seen in the methods here.

  - (id) init {if (self = [super init]) {// custom initialization} auto back; }   

In this case, the super keyword is used to call this class which is the -init method Implementation is called. Super can be used on any method that implements your superclass.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -