On 1 May 2012, at 2:28 AM, ecir hana wrote:

> If nothing else, it would explain to me how things works, 20 lines of
> code would help me better than 20 documentation pages. There tutorials
> above certainly did the explaining very well.

Every few months, a beginner comes who wants to skip NIBs to "see how it 
works." Please understand why experienced developers advise against this, even 
though they understand the impulse.

NIBs _are_ how it works. They don't contain or generate code. They don't 
contain or generate scripts. They don't exercise much of the API you're trying 
to use. They contain archived objects and their connections.

Their effects can (often) be mimicked in code, but by the same token, 
Objective-C can be mimicked in assembly. It is useful to understand a bit of 
assembly when you use a high-level language, but except in special 
circumstances, nobody advocates writing programs in it. And in the case of 
compiling Objective-C, at least the translation passes (notionally) through 
assembly code.

Similarly, it is useful to understand how NIBs are reconstituted into objects, 
but one must understand that the underlying mechanism is reconstitution, not 
executing code that simulates reconstitution. Unlike the translation of a 
high-level language, there is no executable layer through which reconstitution 
passes. (At least in the sense you mean.)

NOTE: On iOS, it is frequently useful to build object hierarchies in code, but 
the Cocoa Touch API is designed to make that easy. Even there, most designs 
take the form of reconstituting objects from NIBs.

        — F


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to