nsurl

how i can implement a custom UIAlertview with a progress bar and a cancel button?

Hi iPhone application developers, I am developing an iphone application. This application allows a user to upload images to my server. I want to show the upload progress in an alertView. I need some example code to illustrate how to implement a custom UIAlertView with a progress bar. Thanks in advance. ...

Removing url fragment from NSURL

I'm writing a Cocoa application, which uses NSURLs -- I need to remove the fragment portion of the URL (the #BLAH part). example: http://example.com/#blah should end up as http://example.com/ I found some code in WebCore that seems to do it by using CFURL functionality, but it never finds the fragment portion in the URL. I've encapsu...

View showed delay

My viewDidAppear methods is in below. My view has a activieIndicator that is animating and a imageView. In viewDidAppear I load an image from my server which will be used as an image of the above imageView. I want until my image is fully loaded, my view will show the animating indicator. But I can not do it. Until full image load, i can ...

Saving video from UIImagePickerController

In my application, the user can record a video using the UIImagePickerController, and I need to save it to disk for later use. I've gotten the path out of the info dictionary and I'm going to save it to my documents directory, but the problem I'm having is that the URL passed in the dictionary is just that - a URL and not a file path. Wh...

NSURL not returning value for Plist example

pListURL returns nil on my code, but not the example. The I copied and pasted the method: (taken from http://samsoff.es/post/iphone-plist-tutorial/) (void)viewDidLoad { NSURL *plistURL = [NSURL URLWithString:@"http://samsoffes.github.com/iphone-plist/HelloWorld.plist"]; *dictionary = [NSDictionary dictionaryWithContentsOfURL:plistUR...

Change NSURL base url to another base URL

I have a NSURL to a local file with no base url. I want to change the base URL to another local directory, with the relative path being in respect to that URL. For example NSURL *path = [NSURL fileURLWithPath: @"/Users/username/Desktop/Photos/Photo1.jpg"]; Now, say I want to change the base part to /Users/username/Desktop/SomeFolder,...

Loading a Wikipedia page

I want to make a button in an UIAlertView that opens a Wikipedia page, with a subject stored in my array "array" Here is how I'm doing it. Wikipedia follows the format of http://en.wikipedia.org/wiki/<subject>. In my array, I have text entries of subjects. I want it to open in mobile Safari when tapped. So far, no luck :( Help ...

Testing file existence using NSURL

Snow Leopard introduced many new methods to use NSURL objects to refer to files, not pathnames or Core Services' FSRefs. However, there's one task I can't find a URL-based method for: Testing whether a file exists. I'm looking for a URL-based version of -[NSFileManager fileExistsAtPath:]. Like that method, it should return YES if the UR...

Parse NSURL path and query (iphoneOS)

Are there any standard objects or functions to parse an NSURL's components? Clearly I could write one, but why re-invent the wheel? [NSURL path] will return an NSString like "argX=x&argY=y&argZ=z" What I would rather get back is a dictionary populated with {@"argX" => @"x", @"argY" => @"y", @"argZ" = @"z"} For the path, which returns ...

How do I download contents into an NSData using a Secure URL?

I'm starting with the following snip to download an image NSError *error = nil; NSString *url = @"https://..."; [NSData dataWithContentsOfURL:[NSURL urlWithString:url] options:nil error:&error]; When this code runs, the error instance contains an error without a whole lot of information in the userInfo. It's just the secure url that ...

URLWithString: returns nil

Hi, it may be very easy, but I don't seems to find out why is URLWithString: returning nil here. //localisationName is a arbitrary string here NSString* webName = [localisationName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString* stringURL = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@,Mon...

NSURL with Thai language

Hi all, I have problem with NSURL and Thailand language for example "http://www.xyp.com?var=ไทย" it does't work but if you use "http://www.xyp.com?var=Thai" it ok. I don't know how to solve this problem anyone please help me. ...

openURL: with a NSURL containing a formatted NSString isn't working

To open Google Maps with directions, i'm using a formatted NSString inside a NSURL. But it doesn't work with [[UIApplication sharedApplication] openURL:nsurl]; code: NSString * directionsURL = [NSString stringWithFormat:@"http://maps.google.com/maps?daddr=%@&saddr=%@", @"Hartenseweg 16, Renkum", @"1 Infinte Loop, Cupertino"]; [...

iPhone NSURL String/HTML Local App Resource Accessed in Another Application

Using iPhone SDK: 3.0 (Firmware 3.1.2) I'm new to iPhone development and researched here and google for a few hours with no luck. Here's the issue: I have an ebook in epub format that I want to sell on the app store, but the app store requirement is that the epub must be contained in an iphone app. So, I decided to make an app that ...

Setting an NSURL with %@ making value equal to %@ instead of inserting %@

Hi, I'm using ASIHTTP and trying to perform a GET request for a site: NSURL *url = [[NSURL URLWithString:@"/verifyuser.aspx?user=%@" relativeToURL:@"http://domain.com"],userName retain]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setTemporaryFileDownloadPath:@"myfile2.txt"]; [request setDownloadDesti...

Play QT movie located in application bundle

I'm trying to run a QT Movie located in my application bundle. Can't get it to work. Can someone advise? thanks. paul -(IBAction)runInternalMovie:(id)sender [ NSString *internalPath; NSURL *internalURL; QTMovie *internalMovie; internalPath = [[NSBundle mainBundle] pathForResource: @"bundledMovie" ofType: @"mp4"]; internalURL = ...

Is it right to say that paths are represented as URI while web-addresses are represented as URL?

I am confused by Apple's documentation about the NSURL class. In NSURL, they say the following: NSURL understands URLs in style of RFC 1808, 1738 und 2732 NSURL understands URIs in style of RFC 2396 Also they say that the RFC 2396 URI are paths. Now what's the difference here? Isn't a path also an URL? I mean, it's an location or n...

Is a path in the Url Loading System of Cocoa always an URL, or sometimes an URI?

I don't get it: An URL is something that really "locates" a ressource, i.e. it holds enough information to say "man, go here, then there, and you have it!" ...while an URI can say "the file is called foobar.foo ... have fun finding it!" Or am I wrong? Can the URL loading system handle URI's? How would that look in example? For me it doe...

Which schemes does NSURL / NSURLRequest / NSURLConnection understand?

Apple says, NSURL is developed using RFC 1738 (and some others). Now RFC 1738 specifies only that an web URL has a scheme and a scheme specific part. I want to know all the schemes which NSURL understands. And because I use it with NSURLRequest and NSURLConnection (the so called "URL Loader System"), I must know all the schemes which ...

URLWithString returns nil for resource path - iphone

Having a problem getting the URL for a resource for some reason: This code is in viewDidLoad, and it's worked in other applications, but not here for some reason: NSString* audioString = [[NSBundle mainBundle] pathForResource:@"sound" ofType:@"wav"]; NSLog(@"AUDIO STRING: %@" , audioString); NSURL* audioURL = [NSURL URLWithString:audi...