Skip to content

Style of Objective-C method parameter names #174

Description

@sirnacnud

I am noticing some odd behavior when specifying the style of the Objective-C record fields with --ident-objc-field. It seems to also apply this style to any Objective-C method parameter, such as in interface methods. I am also specifying --ident-objc-type-param, but this doesn't seem to do anything.

Styles:

--ident-objc-field mFooBar
--ident-objc-type-param fooBar

IDL:

test_record = record {
    foo: f32;
    bar: f32;
}

test_interface = interface +o {
    do_something(foo: f32, bar: f32);
}

Generated Objective-C Classes:

@interface ObjC_TestRecord : NSObject
- (nonnull instancetype)initWithFoo:(float)foo
                               mBar:(float)bar;
+ (nonnull instancetype)testRecordWithFoo:(float)foo
                                     mBar:(float)bar;

@property (nonatomic, readonly) float mFoo;

@property (nonatomic, readonly) float mBar;

@end


@protocol ObjC_TestInterface <NSObject>

- (void)doSomething:(float)foo
               mBar:(float)bar;

@end

In the doSomething method, the lower case m is applied to the bar parameter even though this is just a regular method.

Playing around with the Java generator seems to work correctly, --ident-java-field only effects the record fields and not all parameters.

Should --ident-objc-type-param be used for method parameters instead of --ident-objc-field?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions