Hi!
Am 25.03.2006 um 00:57 schrieb Adrian Robert:
But it's only a warning -- it still works at runtime in either
case. What is the compiler doing differently with the cast? Is it
some performance optimization?
The resulting code doesn't differ. When you pass a message to an
object ("invoke a method"),
the method implementation to be used is always dynamically looked up
in the class tree. In old
Objective-C implementations, there were no typed pointers to objects
(everything was id). The
typed pointers were added afterwards and so the errors the compiler
emits about them are only
intended to be a help for the programmer and won't ever stop
compilation.
The reason why method implementations are looked up everytime is
probably because the
programmer can be allowed to make changes to the class hierarchy on
runtime then.
-Günther
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep