我对这段代码有疑问:我尽力解决但失败了,它的构建成功但警告让我非常恼火。
// Parse content as structure (Atom feeds with element type="xhtml")
// - Use elementName not qualifiedName to ignore XML namespaces for XHTML entities
if (parseStructureAsContent) {
// Open XHTML tag
[currentText appendFormat:@"<%@", elementName];
// Add attributes
for (NSString *key in attributeDict) {
[currentText appendFormat:@" %@=\"%@\"", key,
[[attributeDict objectForKey:key] stringByEncodingHTMLEntities]];
}
// End tag or close
if (ELEMENT_IS_EMPTY(elementName)) {
[currentText appendFormat:@" />", elementName];
} else {
[currentText appendFormat:@">", elementName];
}
问题出在最后几行
if (ELEMENT_IS_EMPTY(elementName)) {
[currentText appendFormat:@" />", elementName];
} else {
[currentText appendFormat:@">", elementName];
}