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

javascript - how to protect a flash video from refresh? -

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

visual studio 2010 - Connect to informix database windows form application -