On Fri, 16 Mar 2012 17:11:24 -0400, Marco Tabini <mtab...@me.com> said:
>> That time has passed now, so you can now completely specify IBOutlets (and 
>> IBActions) in your implementation file and hide the details from the outside 
>> world. If you want properties, you can use a class extension like so to add 
>> them:
>
>Sorry to hijack this conversation, but I've been meaning to ask: Where is this 
>documented? I stumbled on this feature (and the ability to declare ivars 
>directly in the .m file), but I didn't see it explained it anywhere. I'm sure 
>I'm just not looking in the right place, but I can't find it anywhere.

See Apple's document "The Objective-C Programming Language".

In the chapter called "Defining a Class", not only is declaring an ivar in the 
.m file covered, but doing it in the .h file is downright discouraged (rightly 
so). In practice, this feature of Objective-C did not swim into most people's 
ken until Xcode 4.2, when LLVM because the default compiler.

In the chapter called "Categories and Extensions", declaration of private 
properties is discussed. That feature is considerably older.

m.

PS And of course there's also my book, which makes much of these features.

PPS The trouble with language improvements like this, and with documents like 
The Objective-C Programming Language, is that there's a terminus point 
somewhere and they don't tell you exactly when it is. What I mean is, you can 
surprise yourself by adopting an improvement of this sort and then opening your 
project in an earlier version of Xcode that doesn't understand it. Also, 
different *parts* of Xcode may not understand it; for example, your code will 
compile, but the feature where you can drag from an ivar to the nib editor to 
form an outlet might not work (though now, I believe, it does).

--
matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
_______________________________________________

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