Archive for October 9, 2008

Thursday, October 9, 2008

The How and Why of Cocoa Initializers

Mike Ash:

This is why the standard initializer pattern is the only one that works. Cocoa classes can and do deallocate the original instance, then allocate a new instance of the same class (or a subclass) and return it from their initializers. This is admittedly rare, but it is legal and it does happen. And that, in a nutshell, is why the standard Apple initializer pattern is the only correct way.

JSCocoa

JSCocoa “bridges Cocoa to JavascriptCore (WebKit’s JS engine). It allows you to call C code, ObjC code, use C structs, and build Javascript classes inheriting from ObjC classes.”