In Objective-C, what is polymorphism?
Polymorphism is one of the pillars of OOP. In Objective-C, a perfect example of polymorphism uses the “id” keyword. As you know, the id keyword is a ‘general type’ variable that allows you to store any object of this: in this example, your code doesn’t need to know what a method returns; if you store it in an id variable you will be able to use it without problems. Basically, polymorphism means “many forms”: Any object could return anything and you can deal with it. It is easier to explain polymorphism with other languages (like C++), because their polymorphic features are more explicitly shown (like operator overloading or function overloading in C++).