Doxygen: Objective-C class and instance methods with the same name have the same refid

Created on 18 Nov 2019  路  6Comments  路  Source: doxygen/doxygen

When generating XML output for Objective-C interfaces, class methods and instance methods with the same name, result in the same refid. Links to these methods cannot be distinguished.

E.g.

@interface NKTClass
- (void)method;
+ (void)method;
@end

Results in two member defs, each with the exact same refid.

bug

Most helpful comment

I've just pushed a proposed patch, pull request #7639

All 6 comments

  • Can you please attach a, small, self contained example (source+configuration file in a tar or zip) that allows us to reproduce the problem? Please don't add external links as they might not be persistent.
  • Please also specify the doxygen version used.

7406.tar.gz

To run it:

doxygen Doxyfile.Api

In output/xml/interface/_n_k_t_class.xml you will see two methods, one static, one not static, both with the same refid.

I used version 1.8.16

Thanks for the case.
Could you also add some calling code for both methods (with comment which one of the methods is called).

Small note on the Doxyfile.Api the used construct is correct, but not necessary in your case. The Doxyfile you have is the default Doxyfile and when doxygen doesn't find a setting it will use the default setting, so in principle you only have specify the differences in your Doxyfile.Api (like you did) and leave out the @INCLUDE. The @INCLUDE is useful when you have changed settings that are common for a number of projects / configuration settings.
(I quite often use an empty Doxyfile or a Doxyfile with just QUIET=YES in it).

Hi. Let me please join to your discussion. You can find example of usage of static and instance methods in file main.m in attached archive.

Compile commands are below if they're needed:

clang -c main.m
clang -c NKTClass.m
clang main.o NKTClass.o -framework Foundation

7406.zip

I've just pushed a proposed patch, pull request #7639

Thank you for the fix.

Sorry for my late response, it was a very busy time. About the default Doxyfile: I like to have it available for reference, but keep the changes separate for clarity. Having the default Doxyfile checked in also prevents changes to the defaults in later version from changing behavior.

Was this page helpful?
0 / 5 - 0 ratings