• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HEAD request using NSURLConnection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: HEAD request using NSURLConnection (From: Patrick Machielse <email@hidden>)

  • Prev by Date: Re: XCode annoyance :-\
  • Next by Date: Re: Paste Command Unavailable for NSStatusItems
  • Previous by thread: Re: HEAD request using NSURLConnection
  • Next by thread: NSTask Memory Problems
  • Index(es):
    • Date
    • Thread