CCGetDataXML *data = [[CCGetDataXML alloc]init];
NSArray *array = [data parserXML:methodname params:parms className:classname];
[data release];
[array retain];
NSLog(@"parserXMLarray:%@",array);
//返回数组
NSMutableArray *result = [[NSMutableArray alloc]init];
//遍历数组
for (int i = 0; i < [array count]; i++)
{
NSString *string = [array objectAtIndex:i];
if ([string isEqualToString:@"Remote Server Exception"])
{
NSLog(@"远程服务器异常");
[array release];
[result release];
return nil;
}NSLog(@"string:%@",string);
if ([string isEqualToString:@"暂无数据!"] ||
[string isEqualToString:@"暂无图片!"] ) {
[array release];
[result release];
return nil;
}
string = [string stringByReplacingOccurrencesOfString:@"+" withString:@" "];
NSArray *arr = [string componentsSeparatedByString:@"#"];//拆分字符串
NSLog(@"2222222 %d",[arr retainCount]);
if(count != 0 && [arr count] != count) {
[array release];
[result release];
return nil;//必须是4项
}
//[string release];
NSMutableArray *resultArray = [[[NSMutableArray alloc]initWithArray:arr] autorelease];
//[arr release];
NSLog(@"2222222 %d %d",[arr retainCount],[resultArray retainCount]);
resultArray = [self replaceObjectWith:resultArray];//替换没有数据
[result addObject:resultArray];
}
[array release];
return [result autorelease];
UIImage *returnp_w_picpath = [UIImage p_w_picpathWithCGImage:p_w_picpathMasked];
CGImageRelease(p_w_picpathMasked);
return returnp_w_picpath;