In my iOS project, I create a protocol named “XMLElement” and I have a problem on a method of this protocol which must return an instance of my protocol :
@protocol XMLElement <NSObject>
-(XMLElement *) GetParent;
@end
The method GetParent returns the parent element which is XMLElement protocol implementation.
But this does not compile !
Must I have to return id object ? No other way ?
XMLElement is a protocol so you need
Not related to the problem: it is atypical to have a method name begin with an uppercase letter. It should be
getParentrather thanGetParent.