Re: dictionaryWithContentsOfURL Questons
Re: dictionaryWithContentsOfURL Questons
- Subject: Re: dictionaryWithContentsOfURL Questons
- From: Daniel Todd Currie <email@hidden>
- Date: Tue, 19 Oct 2004 08:01:06 +0900
You might save yourself some trouble and take a look at
DTCVersionManager --
http://los.dtcurrie.net/code/
I think Uli Kusterer also wrote some sort of version management class
or framework as well.
-- DTC
On 2004 Oct 19, at 06:09, Andrew Zamler-Carhart wrote:
The best thing would be to do this in a thread. Here is the code that
our apps use for this purpose. This normally times out after ten
seconds in my experience.
- (IBAction) checkVersion: (id) sender {
[NSThread detachNewThreadSelector: @selector(checkVersionInThread:)
toTarget: self withObject: sender];
}
- (void) checkVersionInThread: (id) sender {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *versionDict = [NSDictionary
dictionaryWithContentsOfURL: versionsURL];
if (versionDict != nil) {
// do stuff
} else {
NSLog(@"Unable to download version information.");
}
[pool release];
[NSThread exit];
}
On Oct 18, 2004, at 9:21 PM, Kodex wrote:
Hello all. I am using dictionaryWithContentsOfURL to
check for new versions of a program i am working on,
the problem i am having is that if the user does not
have an internet connection the check will hang
forever (or atleast a long period of time). Is there
an easy way to set a timeout for this function? Thank
you for your time as always.
_______________________________________________
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
_______________________________________________
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