objective c - Can a method return a different return type besides the one specified? -


lets have deck class based on nsobject. have playingcarddeck based on deck class.

how method bellow legal ?

 -(deck *) createdeck  {       return [[playingcarddeck alloc]init];  } 

supposing coded object inheritance correctly: yes, legal because playingcarddeck indeed deck.


Comments

Popular posts from this blog

c# - Derived UserControl layout resets after build -

sql - Postgresql error: "failed to find conversion function from unknown to text" -

Phantomjs login, redirect and render page after pageLoad finishes -