Reputation: 2625
Is there any performance benefits of using static typing in Objective-C? Does it exist just for safety check?
Upvotes: 0
Views: 793
Reputation: 27900
Yes, it's for safety checks only.
Objective-C messages (method invocations) are always dynamically dispatched at runtime. Adding additional static type information will help the compiler warn you of errors, but (for the most part) has no effect on the code generated. See http://en.wikipedia.org/wiki/Objective-C#Dynamic_typing
Upvotes: 1