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
Post a Comment