添加@interface MedicalRecordViewController : UIViewController<UITextFieldDelegate,NSXMLParserDelegate,UITextViewDelegate>
后,我的应用程序仍会在
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:webData];
XmlParser *parser = [[XmlParser alloc] initXMLParser];
if (serviceRequest==1) {
[parser setPageRequest:2];
}else if (serviceRequest==2) {
[parser setPageRequest:5];
}else if (serviceRequest==3) {
[parser setPageRequest:4];
}else if (serviceRequest==4) {
[parser setPageRequest:4];
}
[xmlParser setDelegate:parser]; // warning here
BOOL success = [xmlParser parse];
警告信息
Sending 'XmlParser *' to parameter of incompatible type 'id<NSXMLParserDelegate>'
我的代码有什么问题?我是否应该添加任何其他内容?
答案 0 :(得分:3)
XmlParser
类未实现NSXMLParserDelegate
协议。