nsurl

NSURL Out of Scope

Hi, I've an issue with this piece of code: NSURL *url = [[NSURL alloc] initWithString:@"http://authenticate.radonsystems.net/products.xml"]; NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url]; //Initialize the delegate. XMLParser *parser = [[XMLParser alloc] initXMLParser]; //Set delegate [xmlParser setDelegate:p...

Send POSTs to a PHP script on a server

I have a PHP script on a server <?php // retrieve POST vars $comment = $_POST['comment']; $email = $_POST['email']; // remove trailing whitespace etc $comment = trim($comment); $email = trim($email); // format date accoring to http://www.w3schools.com/php/func_date_date.asp $date_time = date("Y-m-d-H-i-s"); // i.e. 2010-04-15-09-45-2...

By Clicking an html link i want to open that url in browse?

I am opening an html page in web view and By Clicking an html link i want to open the given link in to web browser and my application should close. ...

iPhone: ASIFormDataRequest Returns NULL from PHP Server

Hi, I have PHP script link, which responds YES or NO when we set post userName and emailID. I have used ASI framework. When I try to connect with the following code, I get a null return. NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"]; ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithU...

How do I get the folder numbers from internet

I have a server on the internet which contains several subfolders like followings, each folder contains several datas, I would like to download a certain amount of data from the server (ex: all the data in the folder a\b\01), my question is, how can I get the subfolder number of the folder 01? in this case the number is 8, but how can I ...

How to open a URL containing a fragment (#foo) using SharedApplication and openURL on iPhone

I have a URL containing a fragment part, used to indicate a certain state of the webpage. I want to open this link in Safari on the iPhone by using something like the following: NSURL* fragmentURL = [NSURL URLWithString:@"http://www.exampleurl.com/index.html#foo"]; [[UIApplication sharedApplication] openURL:fragmentURL]; The link is s...

Download files from server and replace how to ??? iphone

Hi all ! I have plist in my App what i liked to do is to download plist from a folder on my website using http://anadress and then replace the plist in the main bundle by the new one i've download. And i have no idea on how to do this. If someone could help. thanks ...

Dialing a command prefix on the iPhone

Our application lets users call phone numbers. Users would like to be able to block their caller ID. On other platforms, we let the user specify a custom dialing prefix. For instance, on my cell provider it's #31#. I've tried two approaches so far. First: id url = [NSURL URLWithString: @"tel:#31#0000000"] // produces nil Second: i...

How do set the max NSURLRequest data size that gets cached?

On the iphone, I'm using NSURLRequest and NSURLConnection to download images into my app. asynchronously. I also want these requests to be cached. What I've noticed is that some of my images do get cached and some don't. I'v implemented the delegate method -(NSCachedURLResponse *)connection:(NSURLConnection *)connection ...

problem with pathForResource

HI all I have problem with NSString *filePaht = [[NSBundle mainBundle] pathForResource:(NSString *)name ofType:(NSString *)ext]; if I used NSString *filePaht = [[NSBundle mainBundle] pathForResource:@"soundName" ofType:@"aiff"]; it's OK but when I used NSString *fileName = [[file.list objectAtIndex:index] objectForKey:@"soundName"]; N...

Comparing an [NSURL path] to an NSString doesn't work

I have this code: NSLog([url path]); if([url path] == @"/connect/login_success.html") { NSLog("IT WORKZ"); } When I run my application, do the login etc... my console says: 2010-05-04 23:49:57.297 Framebook Test Application[8069:a0f] /connect/login_success.html But it should also print IT WORKZ to the console, which it does not...

NSString to NSURL objects

Hello, I have an array that I populated with my plist file, which looks something like this: <array> <string>http://www.apple.com&lt;/string&gt; <string>http://www.google.com&lt;/string&gt; <string>http://www.amazon.com&lt;/string&gt; </array> So, I'm looking to convert these NSString objects to NSURL objects when I call them...

iPhone: Cell imageViews repeating when loaded from url

I'm developing a demo RSS reader for iPhone. I obviously have a tableview to display the feeds, and then a detailed view. Some of this feeds have a thumbnail that I want to display on cell.imageview of the table, and some don't. The problem is that when scrolling the table, loaded thumbnails start repeating on other cells, and I end up ...

iPhone: How to Determine When a Download from a URL has Completed

I need to populate an array using data from a NSURL. How do I determine when the download from the URL has completed? ...

Why Won't this http post request work? Delegate methods not being called

Hi, I'm wondering why this http post request won't work for my iphone app. I know for a fact that the url is correct and that the variables I'm sending are correct but for some reason the request is not being recieved by the aspx page. EDIT:: I re factored the code into its own class with its own delegate methods. The delegate method...

Checking for NSURL load done

Hi folks, I'm looking for a "did finish, or finish" thing in NSURL -> NSstring initWithContentsOfUrl i found "URLResourceDidFinishLoading" but this seems to be depreciated I couldn't find any but maybe I searced for the wrong thing. Thanks in advance Alex ...

didReceiveDataOfLength: Problems in cocoa

Hello, Im trying to get the amont of data downloaded with this - (void)download:(NSURLDownload *)theDownload didReceiveDataOfLength:(NSUInteger)length code from apples website but I need to convert the length to a string. How might I do this? Thanks in advance ...

objective c NSURL may not respond to +initFileURLWithPath

I have two lines of code in the applicationDidFinishLaunching function: NSString *targetFilePath = @"/Users/bob/Documents/About_Stacks.pdf"; NSURL *targetFileURL = [NSURL initFileURLWithPath:targetFilePath]; and I am getting the warning (title) in the second line... I have no idea what I am doing wrong. This is an absurdly simply app...

Open URL with Safari no matter what system browser is set to

In my objective-c program, I need to open a URL in Safari no matter what the system's default browser is. That means that this won't work, because it could launch Firefox or whatever other browser: NSWorkspace * ws = [NSWorkspace sharedWorkspace]; [ws openURL: url]; I think I'm close with this: [ws launchAppWithBundleIdentifier: @"co...

timeout stringwithcontentsofurl

Hi, I have this call to stringwithcontentsofurl: [NSString stringWithContentsOfURL:url usedEncoding:nil error:nil]; How can I give that a simple timeout? I don't want to use threads or operation queues (the content of the url is about 100 characters), I just don't want to wait too long when the connection is slow. ...