3 ms·
Objective C componentization model has its own traps. And too many of them unfortunately. Object's ownership model in particular, when need of `[obj release]`
by c-smile 6y ago
Objective C componentization model has its own traps. And too many of them unfortunately.
Object's ownership model in particular, when need of `[obj release]` is always a guess based on name of constructor function (name should contain "alloc", "new", "copy") but there are exceptions. I cannot even classify such architectural decision...
Among all practical UI systems I know, Windows's approach ( HWND and WndProc ) is the most flexible, stable on the long run. Despite its damn simplicity (or rather because of it?).
- qalmakka 6y agoObjective C is not forced to have such design; if you don't import Foundation you can use plain libobjc and create your own root class, you can name methods however you want. Objective C historically boiled down to basically a preprocessor that transformed its Smalltalk-like additions to C to calls to objc_* functions and C structures. In the years, Apple has added syntax to interface with their own classes (i.e. @autorelease that AFAIK interfaces with NSAutoreleasePool), but that's about it.