Can you upcast in objective-c and how?
Can you upcast in objective-c? if so how?
C# example:
"Asset" is the base class.
Stock msft = new Stock();
Asset a = msft; //开发者_如何学Goupcast
You mean typecast a subclass object to the type of a superclass? Sure - Objective-C has very liberal typecasting rules, just like C.
Superclass *superclassObject = (Superclass *)subclassObject;
精彩评论