Suppress warning: Meta method xx in category from xx conflicts with same method from another category
Asked Answered
F

4

5

How can I suppress this compiler warning: Meta method 'prefix' in category from '...soap+prefix.o' conflicts with same method from another category ? here is the category soap+Prefix.h:

  @interface Soap (Prefix)

   +(NSString*)prefix;

   @end

and soap+prefix.m:

#import "Soap.h"
#import "Soap+Prefix.h"

 @implementation Soap (Prefix)

  +(NSString*)prefix { return @"EInspector"; }

  @end

and these two files by the way are automatically generated with SudZc wrapper for web services.

p.s. this warning is issued ONLY in XCode 4.4

thank you so much in advance.

Flagon answered 27/7, 2012 at 4:33 Comment(0)
B
4

Somewhere else in your project, +[Soap prefix] is being declared in a category. Try searching your project for other declarations of +prefix.

Another possibility is that during a large refactoring or complex merge of your project.pbxproj file, the project ended up with two references or copies of the same file, and both are being compiled. I've seen it happen, and these sorts of warnings or errors are usually what happens. Try searching in the Finder for other files with the same name to see if you have a duplicate file somewhere.

Broadus answered 31/7, 2012 at 4:0 Comment(1)
+[Soap prefix] is declared in two files in the project, although I have searched for it before but couldn't find more than one file, today I found two files, thank you so much for the answer. you may vote up my question too ;)Flagon
D
52

This happened to me when I have accidentally imported an implementation file of a category (.m) instead a header file (.h).

Denti answered 25/8, 2012 at 12:44 Comment(0)
B
4

Somewhere else in your project, +[Soap prefix] is being declared in a category. Try searching your project for other declarations of +prefix.

Another possibility is that during a large refactoring or complex merge of your project.pbxproj file, the project ended up with two references or copies of the same file, and both are being compiled. I've seen it happen, and these sorts of warnings or errors are usually what happens. Try searching in the Finder for other files with the same name to see if you have a duplicate file somewhere.

Broadus answered 31/7, 2012 at 4:0 Comment(1)
+[Soap prefix] is declared in two files in the project, although I have searched for it before but couldn't find more than one file, today I found two files, thank you so much for the answer. you may vote up my question too ;)Flagon
C
3

In my case the issue was due to a wrong merge of project.pbxproj (so similar to Nick Forge's case), which caused too many references to the same file (however the file was physically only once on disk). When I removed redundant references the warning stopped appearing.

Cornellcornelle answered 8/5, 2014 at 8:54 Comment(0)
G
1

You should reference a great answer by someone who also posted something similar:

Is there a way to suppress warnings in Xcode?

In my opinion the 2nd (highest voted) option is the best!

Gabrielson answered 31/7, 2012 at 3:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.