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 (JIRA)" <ji...@apache.org> on 2009/06/05 17:02:07 UTC

[jira] Created: (THRIFT-521) Objective-C 2.0 properties

Objective-C 2.0 properties
--------------------------

                 Key: THRIFT-521
                 URL: https://issues.apache.org/jira/browse/THRIFT-521
             Project: Thrift
          Issue Type: Improvement
          Components: Compiler (Cocoa)
            Reporter: Matt Stevens


On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.

To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:

{code}
#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
@property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
@property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
#endif
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-521) Objective-C 2.0 properties

Posted by "Matt Stevens (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Stevens updated THRIFT-521:
--------------------------------

    Attachment: thrift-521.patch

Patch implementing Objective-C 2.0 property generation. Properties wrap the existing getter and setter functions to insure the internal data structures are still updated properly.

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>         Attachments: thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (THRIFT-521) Objective-C 2.0 properties

Posted by "Matt Stevens (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Stevens reopened THRIFT-521:
---------------------------------


The current implementation causes a compile error under 10.6, where a combination of @synthesize and defined getter/setter methods is no longer supported. While researching the problem I learned that since Thrift follows the Apple naming convention for its generated getter/setter methods this patch was actually not necessary - dot syntax will map to these methods automatically. As a result r796377 can be reverted, fixing the bug, eliminating generated code, and still maintaining dot syntax compatibility.

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Assignee: Andrew McGeachie
>            Priority: Minor
>         Attachments: thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-521) Objective-C 2.0 properties

Posted by "Matt Stevens (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Stevens updated THRIFT-521:
--------------------------------

    Priority: Minor  (was: Major)

Downgrading from major

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Priority: Minor
>         Attachments: thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-521) Objective-C 2.0 properties

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie updated THRIFT-521:
------------------------------------

    Attachment: thrift-521-dynamic.patch

Another solution which keeps the property declarations, is to change the @synthesize to @dynamic.

I've attached a patch for that here.

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Assignee: Andrew McGeachie
>            Priority: Minor
>         Attachments: thrift-521-dynamic.patch, thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-521) Objective-C 2.0 properties

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie resolved THRIFT-521.
-------------------------------------

    Resolution: Fixed

Patch applied.

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Assignee: Andrew McGeachie
>            Priority: Minor
>         Attachments: thrift-521-dynamic.patch, thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-521) Objective-C 2.0 properties

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie resolved THRIFT-521.
-------------------------------------

    Resolution: Fixed

Committed.  Thanks Matt.

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Assignee: Andrew McGeachie
>            Priority: Minor
>         Attachments: thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (THRIFT-521) Objective-C 2.0 properties

Posted by "Andrew McGeachie (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew McGeachie reassigned THRIFT-521:
---------------------------------------

    Assignee: Andrew McGeachie

> Objective-C 2.0 properties
> --------------------------
>
>                 Key: THRIFT-521
>                 URL: https://issues.apache.org/jira/browse/THRIFT-521
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Cocoa)
>            Reporter: Matt Stevens
>            Assignee: Andrew McGeachie
>            Priority: Minor
>         Attachments: thrift-521.patch
>
>
> On platforms that support them it would be useful to declare Objective-C 2.0 properties in the generated objects. If a developer is using properties in their code this can help the generated objects fit in a little better with the rest of the project.
> To maintain compatibility with with pre-10.5 systems the property declarations can be wrapped by a platform-specific ifdef:
> {code}
> #if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
> @property (nonatomic, getter=fancyBool, setter=setFancyBool:) BOOL fancyBool;
> @property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title;
> #endif
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.