4 ms·
And Objective-C isn't really strongly typed either, so you can send anything any message.
by Alphasite_ 12y ago
And Objective-C isn't really strongly typed either, so you can send anything any message.
- andlabs 12y agoFWIW this is specifically why Objective-C has been able to get by without generics for a while. You don't get solid type-checking like you do with generics in other languages (except C++), but that has never really been an issue because the above statement works even with [...] statements (sure, the compiler will warn you, but). The only real issue is that the things you shove into Objective-C containers must themselves be Objective-C types, which means using NSNumber and NSValue everywhere for raw C types. The new Objective-C @literal and @(expression) syntax, however, should make such code cleaner in the future...