在程序中有下述代码片段,我想问问,
1.这个strURL会不会产生内存泄露?
2.如果泄露了,有没有可能导致程序立即崩溃?
- (LSHTTPRequest*)request
{
NSString* strURL = [[commonManager getHostStr] stringByAppendingString:@"/cate.action?act=getlist&type=id"];
if (_categoryID > 0)
{
strURL = [strURL stringByAppendingFormat:@"&id=%d", _categoryID];
}
strURL = [self requestURLByAppendPageParams:strURL];
LSHTTPRequest* request = [[LSHTTPRequest alloc] initWithURL:[NSURL URLWithString:strURL]];
return [request autorelease];
}iPhone 字符串 内存泄露 崩溃
1.这个strURL会不会产生内存泄露?
2.如果泄露了,有没有可能导致程序立即崩溃?
- (LSHTTPRequest*)request
{
NSString* strURL = [[commonManager getHostStr] stringByAppendingString:@"/cate.action?act=getlist&type=id"];
if (_categoryID > 0)
{
strURL = [strURL stringByAppendingFormat:@"&id=%d", _categoryID];
}
strURL = [self requestURLByAppendPageParams:strURL];
LSHTTPRequest* request = [[LSHTTPRequest alloc] initWithURL:[NSURL URLWithString:strURL]];
return [request autorelease];
}iPhone 字符串 内存泄露 崩溃
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货