2 ms·
> ObjectiveC) has the best design decisions (IMHO). ARC instead of manual memory management or GC, strongly typed but still allows generic object pointer (id),.
by pornel 13y ago
> ObjectiveC) has the best design decisions (IMHO). ARC instead of manual memory management or GC, strongly typed but still allows generic object pointer (id),...
It's funny, because objects in Objective-C are dynamically and weakly typed, and as flexible as in JS. The syntax has unnecessary rigidity that doesn't map well to actual semantics of the language.
Message passing in ObjC doesn't care about types (you can send any message to any object, and the receiver can capture the message and do whatever it wants). You can change/add methods (and "associated" properties) at run time, of instances and class definitions, just like in JS.
e.g. Cocoa bindings will subclass your objects (create a new subclass at run time and swap identity of your object) to replace setters with ones that notify the UI.
https://developer.apple.com/library/ios/documentation/cocoa/reference/ObjCRuntimeRef/Reference/reference.html https://developer.apple.com/library/ios/documentation/cocoa/...