NSImage initWithContentsOfURL slowness
NSImage initWithContentsOfURL slowness
- Subject: NSImage initWithContentsOfURL slowness
- From: Nirias <email@hidden>
- Date: Sun, 3 May 2009 16:09:32 -0700
I am trying to grab an image from a network camera but performance is
horrible. My code is:
NSLog(@"refreshImage");
url = [NSURL URLWithString:@"http://192.168.1.253/SnapshotJPEG?Resolution=640x480&Quality=Precision"];
NSLog(@" setURL");
NSImage *image = [NSImage alloc];
NSLog(@" allocated image");
[image initWithContentsOfURL:url];
NSLog(@" initialized from URL"); // Big pause before this log message
[imageView setImage:image];
NSLog(@" done");
Occasionally this runs in about 1 second but usually there is a 10-20
second pause during the initWithContentsOfURL step. I have verified
the camera is working just fine - Firefox and Safari reload the same
url instantaneously every time.
Any idea what I am doing wrong?
Thanks, Nick
_______________________________________________
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