Hello, I would like to download a file without using NSURL/NSURLDownload/CFNetwork. I would like to use something else because I am having issues with people using snow leopard. I have had problems in the past (un-fixable leaks, crashes). Is there a different way to solve this problem?
+1
A:
If you're not willing to use those higher-level APIs, you can drop down to the BSD socket API and manually implement an HTTP connection. However, this is reinventing the wheel, and you should probably stick with the Objective-C/Core Foundation APIs. They are stable; if you're seeing them crash or leak, the problem probably lies in your code.
Can you show us the code where you see the crashes?
Jonathan Grynspan
2010-09-27 23:14:43
Actually, it works totally fine on my machine but just not on snow leopard. I've released my software about three months ago as a beta on macthemes here: http://bit.ly/9SCsDZ The crash reporter reports are available there as well. Thank you for giving me a different perspective on the problem I am currently facing.
alexy13
2010-09-27 23:36:38
Hard to say without code. Looks to me like you're using CFNetwork, but deallocating an object which the framework then tries to send a callback to and crashes.
Mike Abdullah
2010-09-27 23:59:03
To be blunter: the problem is almost certainly not in Apple's code. But we can't be sure unless you show us the code that's giving you trouble.
Jonathan Grynspan
2010-09-28 01:16:45
@alexy13 The page you link to in your comment also has a comment from you point to this: http://github.com/alexyorke/Flick-Background ... the code there doesn't even build, so hopefully that's not the code you're trying to get help for.
imaginaryboy
2010-09-28 01:39:48
I will supply the piece in the code where the application crashes, when the users' on macthemes supply me with the debug information in the new debug build.
alexy13
2010-09-28 09:48:07
Oops, I must have heard wrong when I heard it was in Apple's code. @imaginaryboy That is the code I am trying to get help for; are you using snow leopard to build it?
alexy13
2010-09-28 09:52:45
If that's the code you're trying to build, what's the relevance to your question? I didn't see any uses of `NSURLDownload` or any CFNetwork APIs there (though I might have missed them.)
Jonathan Grynspan
2010-09-28 17:18:10
@alexy13 Yes my quick attempt to build the source was using Xcode 3.2.3 on Snow Leopard. I'd be kind of surprised it builds anywhere. @Jonathan He's using WebKit's WebDownload (why? I dunno) which is a subclass of NSURLDownload.
imaginaryboy
2010-09-29 02:52:31
I saw that, but he didn't mention it in his question, so…
Jonathan Grynspan
2010-09-29 04:10:15
Oh. Big mistake on my part. I'm using [NSData dataWithContentsOfURL: [NSURL URLWithString:@"url"]]. :P.
alexy13
2010-09-29 10:57:59