You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by Matt Stevens <ma...@alloysoft.com> on 2009/05/29 23:13:21 UTC

Objective-C 2.0

Thrift has proven to be really useful on the iPhone so I've been  
making some modifications to the generated Objective-C code to be a  
little more iPhone-friendly, most recently generation of Objective-C  
2.0 properties. Apple uses properties widely in its iPhone sample code  
and for developers that also use them it helps the Thrift model  
objects fit in a little better with the rest of the application.

The issue with this change is that on the Mac side Objective-C 2.0  
requires targeting OS X 10.5 or later. To handle this I added an  
"objc2" option to the Cocoa compiler, but it occurred to me that most  
developers I know are targeting 10.5 for new development and on the  
iPhone this is a non-issue since all releases support objc 2.0.

Before submitting the patch I was curious as to what others thought  
about this - should Objective-C 2.0 features be opt-in or become the  
new default with an opt-out option?

Matt

Re: Objective-C 2.0

Posted by Matt Stevens <ma...@alloysoft.com>.
On May 29, 2009, at 3:41 PM, Andrew McGeachie wrote:

> All my personal and professional development is targeted at Leopard,  
> which probably makes me biased, but I'm fine with requiring 10.5.  
> Not sure how others feel.

After thinking about this a bit more I remembered that the property  
definitions can just be wrapped by a platform-specific ifdef so the  
code would only include properties if the platform supports it. This  
avoids the need for an additional compiler option and the code will  
just adapt.

I was thinking that supporting fast enumeration would be trickier, but  
that may be possible through something like a T_FOR_IN macro as well.

Matt

Re: Objective-C 2.0

Posted by Andrew McGeachie <ge...@gmail.com>.
All my personal and professional development is targeted at Leopard,  
which probably makes me biased, but I'm fine with requiring 10.5.  Not  
sure how others feel.

BTW, thanks for the patches Matt.  I'll try to get yer latest one in  
(and mine!) when I'm not swamped at work.

- a

On May 29, 2009, at 5:13 PM, Matt Stevens wrote:

> Thrift has proven to be really useful on the iPhone so I've been  
> making some modifications to the generated Objective-C code to be a  
> little more iPhone-friendly, most recently generation of Objective-C  
> 2.0 properties. Apple uses properties widely in its iPhone sample  
> code and for developers that also use them it helps the Thrift model  
> objects fit in a little better with the rest of the application.
>
> The issue with this change is that on the Mac side Objective-C 2.0  
> requires targeting OS X 10.5 or later. To handle this I added an  
> "objc2" option to the Cocoa compiler, but it occurred to me that  
> most developers I know are targeting 10.5 for new development and on  
> the iPhone this is a non-issue since all releases support objc 2.0.
>
> Before submitting the patch I was curious as to what others thought  
> about this - should Objective-C 2.0 features be opt-in or become the  
> new default with an opt-out option?
>
> Matt


Re: Objective-C 2.0

Posted by Rush Manbert <ru...@manbert.com>.
On May 29, 2009, at 2:13 PM, Matt Stevens wrote:

> Thrift has proven to be really useful on the iPhone so I've been  
> making some modifications to the generated Objective-C code to be a  
> little more iPhone-friendly, most recently generation of Objective-C  
> 2.0 properties. Apple uses properties widely in its iPhone sample  
> code and for developers that also use them it helps the Thrift model  
> objects fit in a little better with the rest of the application.
>
> The issue with this change is that on the Mac side Objective-C 2.0  
> requires targeting OS X 10.5 or later. To handle this I added an  
> "objc2" option to the Cocoa compiler, but it occurred to me that  
> most developers I know are targeting 10.5 for new development and on  
> the iPhone this is a non-issue since all releases support objc 2.0.
>
> Before submitting the patch I was curious as to what others thought  
> about this - should Objective-C 2.0 features be opt-in or become the  
> new default with an opt-out option?

We need to support 10.4. We don't currently use the Objective-C code,  
but that's just because the server side guys haven't gotten involved  
yet. Please provide the opt out.

Best regards,
Rush