开发者

getting memory leak

NSDictionary *headerFields = [(NSHTTPURLResponse*)response allHeaderFields]; 
    NSURL *url = [NSURL URLWithString:@"https://secure.tesco.com/clubcard/clubcard/main.asp"];
    NSArray *theCookies = [NSHTTPCookie cookiesWit开发者_如何学ChResponseHeaderFields:headerFields forURL:url];

   self.mHeaderResponseData= [NSString stringWithFormat:@"%@", [theCookies objectAtIndex:2]];

mHeaderResponseData having retain property ...

this code is inside connectionDidRecievResponse method

any idea ... and i am releasing mHeaderResponseData in dealloc


Did you alloc and initialize mHeaderResponseData variable in other functions also or not.

if yes then you need to release it when you are doing stringWithFormat:

and

This line will create mHeaderResponseData without incrementing the retain count.

self.mHeaderResponseData= [NSString stringWithFormat:@"%@", [theCookies objectAtIndex:2]];

so instead use initWithFormat:

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜