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:
精彩评论