0

when I build my project I have this warning:

ld: warning: instance method 'shareMessage' in category from /Users/attiliopatania/Library/Developer/Xcode/DerivedData/.../Objects-normal/armv7/Place+Factory.o conflicts with same method from another category

I'm not be able to understand where is the issue with the structure I report to you, maybe I make a mistake on using the categories This issue born when I force myself to use the pattern of @class declaratin on .h file and #import of the useful headers class witinh the .m I hope that somebody can help me :)

shareMessage is a method declared within the class Bean.h that is parent for Place+Factory in this way:

Place+Factory.h

#import "Place.h"

@interface Place (Factory)
...
@end

Place+Factory.m

#import "Place+Factory.h"
#import "User+Factory.h"


@implementation Place (Factory)

...

- (NSString*) shareMessage{
     return @"myMessage"
}


...
@end 

NB: User+Factory have the same structure of PlaceFactory and it is a child of Bean too.

Place.h

#import "Bean.h"

@interface Place : Bean
...


@end

Bean.h

#import <Foundation/Foundation.h>
#import "HttpFunction.h"
#import "Usefull.h"
#import "AppManager.h"


@interface Bean : NSObject
...
- (NSString*) shareMessage;


@end

Bean.m

#import "Bean.h"

@implementation Bean 

...

- (NSString*) shareMessage{
    return [self.class description];

}

...
@end

updated: at the end I solved. I review all my classes handling where possibile @ class within the .h files and the # import order within the .m files (that it seems to be the real issue).

4

1 回答 1

0

因为 Place 类已经有方法 shareMessage,所以它从 Bean 继承了这个方法。@implementation Bean(工厂)更改为@implementation Bean

于 2013-08-06T06:38:55.283 回答