Re: Crash from NSURLConnection if delegate released too soon?
Re: Crash from NSURLConnection if delegate released too soon?
- Subject: Re: Crash from NSURLConnection if delegate released too soon?
- From: Jens Alfke <email@hidden>
- Date: Mon, 25 Aug 2014 14:13:42 -0700
> On Aug 25, 2014, at 1:43 PM, Howard Moon <email@hidden> wrote:
>
> The Apple docs show simply setting the connection and receivedData to nil, instead of calling release on them.
Do you have a strong [sic] reason to be using manual retain/release? If not, I'd _really_ recommend switching to ARC, at least for this one source file, especially since it sounds like you don't have the memory-management rules firmly memorized yet.
Have you run the static analyzer (Cmd-Shift-B)? It's good at finding and explaining ref-counting mistakes.
Have you tried using NSZombie? That's a good way to track down over-released objects at runtime. (See Technical Note TN2239, iOS Debugging Magic.)
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden