alice
alice

Reputation: 2625

Performance benefits of static typing in Objective-C

Is there any performance benefits of using static typing in Objective-C? Does it exist just for safety check?

Upvotes: 0

Views: 793

Answers (1)

David Gelhar
David Gelhar

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

Related Questions