nsurl

Objective-C and NSURL: where am I supposed to declare receivedData?

I have a two classes, a controller called "AppController" and a class called "URLDelegate" that encapsulates the sample NSURL code from Apple's URL Loading System Programming Guide. The guide repeatedly mentions declaring the receivedData instance variable "elsewhere." I assume this means outside of the URLDelagate class, because if I ...

How to make an NSURL that contains a | (pipe character)?

Hi all, I am trying to access google maps' forward geocoding service from my iphone app. When i try to make an NSURL from a string with a pipe in it I just get a nil pointer. NSURL *searchURL = [NSURL URLWithString:@"http://maps.google.com/maps/api/geocode/json?address=6th+and+pine&bounds=37.331689,-122.030731|37.331689,-122.030731&...

leaks when using NSData, NSURL,NSMutableURLRequest,NSURLConnection and sendSynchronousRequest

Hi Guys, I am getting the leak at this line in below code" NSData *returnData = [NSURLConnection ..........." NSURL *finalURL = [NSURL URLWithString:curl]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:finalURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:...

UIWebView Error

Hi all, I am getting an error while loading a url in uiwebview "malloc: * error for object 0x2841000: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug" But when i change the url to google.com ,it works fine without any error. what is this error due to ? ...

How to chop off file:// from NSURL

I have an NSURL. It is file://localhost/Users/Me/File.xml I want an NSString that is /Users/Me/File.xml Is there some nice function I can use to do this? ...

persisting launchOptions NSURL as global variable

I have associated my app with a UTI so that users can launch KML attachments. In the iPad app delegate of my universal app I can see the launchOptions and from these I get an NSURL for the file being launched. I want to store this as a global so that I can access it from elsewhere in my app, I am doing this using a singleton called Engin...

NSXMLParser adds extra characters to every string

I am creating a simple FeedReader iPhone app where a RSS is feed is parsed using NSXMLParser. The code to parse the RSS is a standard code similar to the one shown here. But I noticed that every parsed element has the '\n\t\t' characters at the end. Ex. link = "http://bakery.cakephp.org/articles/view/exporting-data-to-csv-the-cakephp-...

stringByAddingPercentEscapesUsingEncoding not working with NSStrings with ' 0'

Hi ! I have been having some problem with the stringByAddingPercentEscapesUsingEncoding: method. Here's what happens: When I try to use the method to convert the NSString: "..City=Cl&PostalCode=Rh6 0Nt" I get this this.. "City=Cl&PostalCode=Rh62t" It should be: "..City=Cl&PostalCode=Rh6%200Nt" What can I do about this? Thanks ...

how to pass local path to NSXMLParser

how to pass local path to NSXMLParser like this NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:storePath]; where storepath is a local path like this: /var/mobile/Applications/56EEB906-2B73-493C-9BE7-2732440CDB69/Documents/xml1.php and my code is like this: //NSURL *urla = [[NSURL alloc] initWithString:storePa...

Rebuild a download App with a little Code I've found

Hello Guys, I'm searching for a Code, which can Download MP3 Files via Webview to a Folder on my Device. These Files should be listed on a Second tab, where you can delete them, if you want. After a long while of searching I've found this: http://pastie.org/pastes/833713 It looks, like an IPA Download Script and I want to use it, but ...

Problem with Tiny URL

Hi Guys! I am developing Twitter API to my application. In my app, I want to display the tiny url with parsed xml link in UITexField as dynamically. statically, I could able to display tiny url in UITextField, but dynamically I am not able to display the tiny url. Please help me! Code: statically(Working fine), NSURL *url = [NSURL UR...

many retains placed on NSURL when using arrayWithContentsOfURL

I am creating an NSArray from a URL that points to a plist NSLog(@"_url rc:[%d]",[_url retainCount]); //prints "_url rc:[1]" content = [NSArray arrayWithContentsOfURL:_url]; NSLog(@"_url rc:[%d]",[_url retainCount]); //prints "_url rc:[10]" I'm completely at a loss as to why this is occurring. Let me know if you need further informat...

NSURL not getting allocatd with NSString

Hi all, This' strange because all my other NSUrls in program are working properly but this one isn't getting allocated with NSString. I'm using: urlStr_ = [NSString stringWithFormat:@"http://192.168.10.2/justmeans/trunk/appaddgoodwork?gencode=%@&deviceid=@%@&sessionkey=%@&userid=%@&updatetext=%@&companyid=%d&ser...

iPhone SDK: How to send data to a server over the internet?

hi everyone, i wrote a gps-application for the iphone and it all works fine but now i want to send the latitude and longitude to a server over the internet using the most simple way... I have a url from the server in which there are parameters for latitude and longitude. Also i want the lat. and long. to be sent every 90 seconds or so. ...

Issue using Variables to load PDF File in iphone SDK

Hi all, I'm trying to load a PDF in my App: Using this works fine pdfURL=[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource: @"myFile" ofType:@"pdf"]]; controller.pdfUrl = pdfURL; [self.navigationController pushViewController:controller animated:YES]; [controller release]; Howev...

NSURLConnection get URL

Hi, how i get the URL inside the following method ?? - (void)connectionDidFinishLoading:(NSURLConnection*)theConnection ...

NSURL declaration /allocation showing error

Hi I Have tried NSString *alertTxt =textfieldName.text; NSLog(@"Name: %@",alertTxt); NSURL *urlAddress = [[NSURL alloc ] initWithString: @"%@/login/index.php",alertTxt]; error : too many argument to function initstring .. the user will giv the url address to the alertText field and i hav to embed in to the webkit may i know the proc...

NSURL Error Handling

Hi everyone, my app is supposed to make a request from a server every 10 seconds or so with a specific url, change some attributes in the url, and then show the request in another view called "updateView" or if any network error occurred display the error. The first part works fine but if i switch of wifi for example the app crashes. How...

iPhone convert NSString to NSURL error

I'm trying to convert the following NSString api call to a NSURL object: http://beta.com/api/token="69439028" Here are the objects I have setup. I have escaped the quotation marks with backslashes: NSString *theTry=@"http://beta.com/api/token=\"69439028\""; NSLog(@"theTry=%@",theTry); NSMutableURLRequest *url = [[NSURL alloc] URLWit...

How to declare the nsurl variable with inital value as nil and also for nsarray?

Hi, This is a simple and basics but I had a doubt that if it is declared globally with out initial value what happens ? NSURL *finalURL; // here i need to initial value as nil if it is like this NSURL *finalURL=@""; giving warning. nssarry *array=nil; // is this correct. Please give the reply, Thank You, Madan Mohan. ...