Re: Help with NSURLDownload crash
Re: Help with NSURLDownload crash
- Subject: Re: Help with NSURLDownload crash
- From: Nicko van Someren <email@hidden>
- Date: Wed, 17 Nov 2004 16:19:04 +0000
On 17 Nov 2004, at 15:45, John Schilling wrote:
Anyway, things work so-so most of the time. But eventually, the app
*always* crashes. Sometimes right away, sometimes after a few minutes.
Here's the output from the debugger:
#0 0x90831204 in objc_msgSend
#1 0x90a10cc8 in -[NSSimpleHTTPURLProtocol _handleLoadCallback]
#2 0x909f707c in -[NSArray makeObjectsPerformSelector:withObject:]
...
I'm at a total loss here. I have *no* idea what is causing this
crash, as I'm not experienced enough to understand the crash logs.
Looking at the debugger crash information I would make a wild guess
that the failure is caused by either corruption of, or more likely
premature release of the client (object implementing
NSURLClientProtocol) of the HTTP protocol object, which is probably the
NSURLDownload object. Is it possible that you are not correctly
retaining the download objects in your nodes?
NSURLDownload is by far the simplest way to get images off the
internet (that I know of), and I'm not really keen on using something
else. But as it stands right now, the app is useless.
There are several other ways to do this which you might consider. One
is simply to use NSImage initWithContentsOfURL:, possibly doing this in
a separate thread (or pool of threads). Another is to use
NSURLConnection to fetch the data and use the facility in
NSBitmapImageRep for incremental loading, which can allow you to
display parts of the image sooner (which is particularly good if the
image is in some sort of incremental or interlaced format).
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden