nsurl

NSURLConnection downloads only the first 567 bytes?

Hi, I'm trying to download http://www.vesseltracker.com/earth/vesseltrackerlight.kmz but am not getting all the bits and pieces. I tried: NSData *data = [NSData dataWithContentsOfURL: serverURL options: 0 error: &error]; to no avail then switched to - (void)startDownloadingURL:(NSURL*) url { // Create the request. NSUR...

iPhone - Save URL without setURL:forKey: and NSURL

Is there anyway to save a URL with NSUserDefaults without setURL:forKey: that is only available to iOS 4.0 and later? I am loading HTML files locally with fileURLWithPath, and it starts at an intro page and the user can click through to whatever. For now, everytime a user starts over it loads back default to intro.htm. I would like to b...

Is it safe to use the "hash" method to track NSURLConnections in memory?

My question is related to this discussion: http://www.cocoabuilder.com/archive/cocoa/202211-how-to-get-nsurl-form-nsurlconnection.html I am sending several NSURLConnections to transmit data and need to be able to tell which specific connection failed or succeeded. There are NSURLDelegate methods (didFailWithError, etc) which return the ...

Reading string from a URL and then loading it's image in an UIImageView

I've got the following code that loads on an UIImageView the image that I want from the internet: NSString* mapURL = @"http://mydomain.com/image-320x480.png"; NSData* imageData = [[NSData alloc]initWithContentsOfURL:url]; UIImage* image = [[UIImage alloc] initWithData:imageData]; [marcaBackground setImage:image]; [imageData release]...

Parsing XML Code Question

I found the following tip for parsing XML in Objective-C on a post on this site. However, y always seems to equal null. I'm wondering if someone can clarify what is going on here. NSString * q = [myURL query]; NSArray * pairs = [q componentsSeparatedByString:@"&"]; NSMutableDictionary * kvPairs = [NSMutableDictionary dictionary]; for (...

iphone audio foundation & stream with HTTP

hi i want read one << mp3 url >> minus 30 sec with button in iphone can i work this with audio foundation this is my code but its not work NSString *str = "my url"; NSURL *file =[[NSURL alloc]initFileURLWithPath:str]; AVAudioPlayer *p = [[AVAudioPlayer alloc]initWithContentsOfURL:file error:nil]; [file release]; self.player = p...

Using NSURL when file path has whitespace

Possible Duplicate: Load PDF from documents directory - iPhone I am trying to load a file from the documents directory. Here is my code: // Get Documents Directory NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [searchPaths ob...

Why is -[NSPasteboard writeObjects:] returning NO for an array of NSURL objects?

I have an NSArrayController that I'm using to provide data to an IKImageBrowserView. I want to support drag and drop from the IKImageBrowserView to other applications. Here's the relevant method from my code: - (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(NSPasteb...

stringWithContentOfURL return an empty string

Hi, i have a problem with the method "[NSStrng stringWithContentOfURL:url]"; all things worked so fine until i change my url from a web address to an ip address with which i got an empty string. Did you have a solution or an idea? Thks ...

NSFileHandle fileHandleForReadingFromURL can someone explain this to me please?

I am trying to make a customized input stream based off of the one by Dave DeLong here that also allows for reading data from a server via NSURL. So far, I have this approach, which works fine for local files: @interface RJRStreamReader : NSObject { @private NSFileHandle *fileHandle; NSStringEncoding encoding; NSString *...

NSURL is nil when using NSDate

Hi guys, I have an NSURL which contains a URL and a variable that is an NSDate: NSURL *url = [[[NSURL alloc] initWithString:[NSString stringWithFormat:@"http://www.googlebio.com/xml_test.aspx?date=%@",self.storeDate]] autorelease]; I also tried it this way but to no avail: NSString*string = [NSString stringWithFormat:@"http://www.go...

Objective C write to Remote URL

Ok, so I have the correct username / pass for a remote host, and I have a NSURL Object referring to the file on the server. How can I possibly write data to that server via Objective-C? I cannot find anyone with this problem, so you help would be greatly appreciated! ...

Play Lengthy video using NSURL in MPMoviePlayerController problem?

Hi I have a lengthy video in server,if i try to play that video in iphone using the code below NSURL *url = [NSURL URLWithString:@"http://somelengthyvideo.mp4"]; player = [[MPMoviePlayerController alloc]initWithContentURL:url]; [player play]; i am facing the following problem. the buffering time is very slow, compare to the video p...

Parse NSURL query property

Hi there I have a URL like myApp://action/1?parameter=2&secondparameter=3 With the property query I get following part of my URL parameter=2&secondparameter=3 Is there any way easy to put this in a NSDictionary or an Array? Thx a lot ...

How to get file size and current file size from NSURL for AVPlayer iOS4.0

self.player = [[AVPlayer playerWithURL:[NSURL URLWithString:@"http://myurl.com/track.mp3"]] retain]; I am trying make a UIProgressView for the above track. How do I obtain the file size and current file size from that URL? Please help, thanks! ...

Loading pdf file from Resource directory in iphone crashes

NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"sampleLayout.pdf" withExtension:nil]; this above line warns NSBundle may not respond to -URLForResource:withExtension: and the app crashes while loading the pdf file from this url path ...

NSURL fileURLWithPath where NSString has a space

Hello, I've looked at quite a few of the related questions and cannot find a similar problem or a solution so my apologies if there is a duplicate out there somewhere. Anyway, I'm trying to generate a file's NSURL to use with an NSXMLDocument. I have the following components: const NSString * PROJECT_DIR = @"~/SP\\ BB/"; const NSStrin...