Re: HEAD request using NSURLConnection
Re: HEAD request using NSURLConnection
- Subject: Re: HEAD request using NSURLConnection
- From: Daniel Miao <email@hidden>
- Date: Fri, 23 Jan 2004 14:55:24 -0500
Thanks Patrick,
I was also struggling with that issue when I was messing around with
this code. My app kept crashing somewhere during processing of the
autorelease pool. Then I finally realized that it was probably because
response and error were autoreleased (I was trying to release them
manually after using them in the method). So I think your feel of the
situation is probably accurate.
Thanks! =)
Daniel
On Jan 23, 2004, at 7:42 AM, Patrick Machielse wrote:
I also want to point out a memory leak in your code. In my experience
sendSynchronousRequest::: returns response and error as autoreleased
objects. You only have to pass 'adresses of pointers to NSURLResponse
and
NSError'. So:
NSError *error;
NSURLResponse *response;
NSData *dataReply;
dataReply = [NSURLConnection sendSynchronousRequest:request
returningResponse:&response
error:&error];
Should suffice. This isn't in the documentation but I _feel_ this is
the way
to do it :-)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.