Objective-C and the Interface section

Joined
Jul 29, 2008
Messages
1
Reaction score
0
Points
1
Hi all,

Please don't blow my head off if this is the wrong place to ask this question, but I haven't found a better place yet. If it's wrong, please let me know where I can repost this for best results. Thanks.

So I am learning Objective-C, and find that a lot of questions are easily resolved online or in a book somewhere, but I took a look inside of UIView.h and saw the sections:

@interface UIView(UIViewGeometry)
...
@end

and

@interface UIView(UIViewHierarchy)
...
@end

and don't really know for sure what these are. I have looked everywhere to see if I can find an explanation of the @interface declaration that uses open and clode parens, and can't find any discussion on that whatsoever. Can someone explain this to me?

Just curiosity at this point, but I would like to know in case I ever want to use this for some reason.
Thanks...
Bruce
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
You want to learn about Categories. I don't think we can add anything beyond the below links. The short answer is you use categories to add methods to an existing class where you don't need to add variables. This avoids the expense of subclassing where it isn't needed.

Cocoadevcentral's Learn Objective-C.

Apple's Introduction to The Objective-C Programming Language.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top