[ https://issues.apache.org/jira/browse/THRIFT-3029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James E. King III resolved THRIFT-3029. --------------------------------------- Resolution: Won't Do Assignee: James E. King III Fix Version/s: 1.0 As support for the older cocoa compiler and library have been removed (see THRIFT-4719), all of the issues in Jira related to that code have also been removed. For legacy cocoa support you can use version 0.12.0 - everyone is expected to move to swift if they want to use the next release of Thrift. > Getters for fields defined with uppercase names do not work > ----------------------------------------------------------- > > Key: THRIFT-3029 > URL: https://issues.apache.org/jira/browse/THRIFT-3029 > Project: Thrift > Issue Type: Bug > Components: Cocoa - Compiler > Affects Versions: 0.9.2 > Reporter: Wes Henderson > Assignee: James E. King III > Priority: Critical > Fix For: 1.0 > > > Using a thrift file such as: > {code:title=foo.thrift|borderStyle=solid} > struct Foo { > 1: required i32 Bar; > 2: required i32 baz; > } > {code} > The generated Objective-C object, "baz" will have working getters but "Bar" > will not. For example, after setting bar to 5 and baz to 9, I get the > following output depending on the syntax: > {code} > [foo bar] => 0 > [foo Bar] (private method invoked by performSelector) => 5 > foo.bar => 0 > foo.Bar => 0 > foo.baz => 9 > {code} > The problem is that the generated header specifies a lowercase getter: > {code:} > @property (nonatomic, getter=bar, setter=setBar:) int32_t Bar; > {code} > Whereas the .m file uses uppercase: > {code} > - (int32_t) Bar { > return __Bar; > } > {code} > When the Objective-C compiler sees that there is no lowercase getter > implementation provided, it automatically generates one (this is supposed to > be a convenience of the @property syntax). So effectively, two getters are > defined: a lowercase one that does not work, and an uppercase one that does > work but is private. > As a workaround one can define all their fields beginning with a lowercase > letter, if possible. -- This message was sent by Atlassian JIRA (v7.6.3#76005)