小编alb*_*iti的帖子

为什么我会收到构建警告,说:"格式字符串不使用数据参数"?

我有这个代码的问题:我尽力解决但我失败了,它的构建成功但警告非常烦我.

// 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];
    }
Run Code Online (Sandbox Code Playgroud)

问题出在最后几行

    if (ELEMENT_IS_EMPTY(elementName)) {
        [currentText appendFormat:@" />", elementName];
    } else …
Run Code Online (Sandbox Code Playgroud)

xcode objective-c ios

1
推荐指数
1
解决办法
2689
查看次数

标签 统计

ios ×1

objective-c ×1

xcode ×1