views:

41

answers:

1

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
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
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
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
@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
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
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
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
@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
I saw that, but he didn't mention it in his question, so…
Jonathan Grynspan
Oh. Big mistake on my part. I'm using [NSData dataWithContentsOfURL: [NSURL URLWithString:@"url"]]. :P.
alexy13