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# - HttpResponseMessage System.InvalidOperationException -

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