Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Objective-c > Re: Extensions ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 10 Topic 936 of 1039
Post > Topic >>

Re: Extensions vs categories

by Gregory Weston <uce@[EMAIL PROTECTED] > Dec 27, 2007 at 07:34 AM

In article <fkvu51$56v$1@[EMAIL PROTECTED]
>, ActiveMan <basurero@[EMAIL PROTECTED]
> 
wrote:

> Hello, according to Apple do***entation "The Objective-C 2.0 
> Programming Language (pag 43)", extensions are a way to differentiate 
> between a public API and an API for the class of the framework. IMO 
> categories also accomplish the same requirement. So my doubts are:
> 
> 1. Are extension a new feature in Objective-C 2.0, because it's not 
> present in previous releases of "The Objective-C Programming Language".
> 2. Where is the conceptual difference between categories and 
> extensions. Or is just a question of flavors.
> 
> Regards.

The primary difference is right in the docs:

"Class extensions allow you to declare additional *required* API for a 
class in locations other than within the primary class @[EMAIL PROTECTED]
 block, 
...."

Extensions are a promise, categories are a suggestion. The compiler can 
impose more requirements and the runtime can make more assumptions. They 
mean an end, as people migrate to Obj-C 2.0, to the clutter of:

@[EMAIL PROTECTED]
 Foo (Foo_private)
//...
@[EMAIL PROTECTED]
 all you really wanted to do was avoid publi****ng some of your API 
via the header.
 




 10 Posts in Topic:
Extensions vs categories
ActiveMan <basurero@[E  2007-12-27 11:21:46 
Re: Extensions vs categories
Gregory Weston <uce@[E  2007-12-27 07:34:07 
Re: Extensions vs categories
ActiveMan <basurero@[E  2007-12-27 17:23:47 
Re: Extensions vs categories
Michael Ash <mike@[EMA  2007-12-27 11:20:39 
Re: Extensions vs categories
Gregory Weston <uce@[E  2007-12-27 13:33:40 
Re: Extensions vs categories
ActiveMan <basurero@[E  2007-12-27 20:57:18 
Re: Extensions vs categories
Michael Ash <mike@[EMA  2007-12-27 16:31:52 
Re: Extensions vs categories
ActiveMan <basurero@[E  2007-12-28 15:40:49 
Re: Extensions vs categories
Reinder Verlinde <rein  2007-12-28 16:13:27 
Re: Extensions vs categories
Michael Ash <mike@[EMA  2007-12-28 10:41:46 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 7:49:04 CDT 2008.