Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch Available
Description
Given the following thrift file:
namespace cocoa XX const list<string> MY_THINGS = [ "a", "b", "c" ] const string MY_CONSTANT = "Hello!"
The generated class looks like:
static NSArray * XXMY_THINGS; static NSString * XXMY_CONSTANT = @"Hello!"; @implementation XXfooConstants + (void) initialize { MY_THINGS = [[NSArray alloc] initWithObjects: @"a", @"b", @"c", nil]; } + (NSArray *) MY_THINGS{ return MY_THINGS; } + (NSString *) MY_CONSTANT{ return MY_CONSTANT; } @end
... but, it needs to look as it does below with the correct prefixing in the initialize and getter methods:
static NSArray * XXMY_THINGS; static NSString * XXMY_CONSTANT = @"Hello!"; @implementation XXfooConstants + (void) initialize { XXMY_THINGS = [[NSArray alloc] initWithObjects: @"a", @"b", @"c", nil]; } + (NSArray *) MY_THINGS{ return XXMY_THINGS; } + (NSString *) MY_CONSTANT{ return XXMY_CONSTANT; } @end