Ios 错误:实现也将由其主类实现的方法
这是我的应用程序中错误部分的编码Ios 错误:实现也将由其主类实现的方法,ios,objective-c,Ios,Objective C,这是我的应用程序中错误部分的编码 - (id)initWithData:(NSData *)data <-------- options:(NSUInteger)options error:(NSError **)error { return [self initWithData:data content:XMLDocument options:options error:error
- (id)initWithData:(NSData *)data <--------
options:(NSUInteger)options
error:(NSError **)error
{
return [self
initWithData:data
content:XMLDocument
options:options
error:error
obj-c中的
-(id)initWithData:(NSData*)data类别应该向基类添加一些方法。不替换现有功能。
不能声明具有与已存在的相同签名的方法
如果要覆盖现有方法(initWithData:…),则应该使用继承,而不需要类别。如果没有-请更改方法名称,例如:
- (id)initWithXmlData:(NSData *)data options:(NSUInteger)options error:(NSError **)error
错误信息对我来说已经很清楚了