0

在此处输入图像描述

大家好,

在我的 iPhone 应用程序中,当我在显示这些错误的设备上运行它时。那么请告诉我这些会是App被拒绝的原因吗?

请告诉我,为什么会出现这些错误?

这是我正在使用的代码。请看一下:

NSMutableString* s = [[[NSMutableString alloc]init]autorelease];
[s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
[s appendFormat: @"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns=\"%@\">", ns];
if(headers != nil && headers.count > 0) {
    [s appendString: @"<soap:Header>"];
    for(id key in [headers allKeys]) {
        if([[headers objectForKey: key] isMemberOfClass: [SoapNil class]]) {
            [s appendFormat: @"<%@ xsi:nil=\"true\"/>", key];
        } else {
            [s appendString:[Soap serializeHeader:headers forKey:key]];
        }
    }
    [s appendString: @"</soap:Header>"];
}
[s appendString: @"<soap:Body>"];
[s appendFormat: @"<%@>%@</%@>", method,[params stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"], method] ;
[s appendString: @"</soap:Body>"];
[s appendString: @"</soap:Envelope>"];
return s;
4

2 回答 2

0

我认为您创建了一个 NSMutableString。如果你不使用 ARC,你必须释放它。

于 2012-06-21T11:55:53.553 回答
0
NSMutableString* s = [[[NSMutableString alloc]init]autorelease];
[s appendString: @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"];
[s appendFormat: @"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns=\"%@\">", ns];
if(headers != nil && headers.count > 0) {
    [s appendString: @"<soap:Header>"];
    for(id key in [headers allKeys]) {
        if([[headers objectForKey: key] isMemberOfClass: [SoapNil class]]) {
            [s appendFormat: @"<%@ xsi:nil=\"true\"/>", key];
        } else {
            [s appendString:[Soap serializeHeader:headers forKey:key]];
        }
    }
    [s appendString: @"</soap:Header>"];
}
[s appendString: @"<soap:Body>"];
[s appendFormat: @"<%@>%@</%@>", method,[params stringByReplacingOccurrencesOfString:@"&" withString:@"&amp;"], method] ;
[s appendString: @"</soap:Body>"];
[s appendString: @"</soap:Envelope>"];
return s;

这是我正在使用的代码。请看一下。

于 2012-06-21T11:59:50.737 回答