Re: EXC_BAD_ACCESS when trying to use [NSMutableURLRequest setHTTPBodyStream]
Re: EXC_BAD_ACCESS when trying to use [NSMutableURLRequest setHTTPBodyStream]
- Subject: Re: EXC_BAD_ACCESS when trying to use [NSMutableURLRequest setHTTPBodyStream]
- From: Dave Carrigan <email@hidden>
- Date: Thu, 10 Jan 2008 09:29:14 -0800
On Jan 10, 2008, at 8:52 AM, I. Savant wrote:
I've had this suggestion from a few people, so I'm going to report
back to the list that the unretained objects is not the cause of my
problem. I changed my code to look like:
Is the "Uploader" object that contains this code retained as well?
You set it as the delegate of your NSURLConnection. Is it still around
when the NSURLConnection instance you create makes calls back to your
Uploader instance?
Yes it is, because it's not autorelease. It's alloced with [[Uploader
alloc] initWithURL] and I never do a dealloc on it. (But just to be
sure, I just added a retain there, with no change in the crash.)
The error you're reporting *is* memory-management-related.
Yes, that seems reasonable, but the more I think about it, the more I
think it must be a bug in the library. Based on the stack trace, it
seems like it's a problem with the NSInputStream object, but I even
tried doing
NSInputStream* stream = [[[NSInputStream ....] retain] retain]
retain]
to try and workaround it if something is doing an extra release, but I
still get the same crash.
--
Dave Carrigan
email@hidden
Seattle, WA, USA
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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