0

I have a file on the web, that looks like this. I would like to update the value a 1 tag Let's say "tempset" and change 150 for another number. How can i do this? NSURLConnection? NSMutableURLRequest? NSURLRequest? If possible keep it to iOs 4! Thanks!

<Courbe>
<age>45</age>
<tempdesi>150</tempdesi>
<vmininit>35</vmininit>
<tempinit>220</tempinit>
<unittemp>0</unittemp><te_fin_c>220,700,700,700,700,700,700,700,700,700</te_fin_c>          <vm_fin_c>50,50,50,50,50,50,50,50,50,50</vm_fin_c>
<grfan_a>1,1,1,1,1,1,1,1,1,1</grfan_a>
<ecarnuit>0</ecarnuit>
<tempset>150</tempset>
<tempsetp>700</tempsetp>
<jo_cou_t>1</jo_cou_t>
<ty_stcha>1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1</ty_stcha>
</Courbe>
Ben Lefebvre
  • 359
  • 5
  • 21
  • You need to access it via FTP - Look at this SO post http://stackoverflow.com/questions/1354012/uploading-and-downloading-via-ftp-with-iphone-sdk – Jonathan King Aug 08 '12 at 15:36
  • What access do you have to your webserver? FTP? SSH? That question is important. If your web server allowed RESTful access, you could update a resource using the POST method. NSURLConnection versus NSMutableURLRequest is irrelevant at this point -- find out or decide what method of access to write the file is possible first! – occulus Aug 10 '12 at 15:54
  • I believe I can access it with FTP but I cannot tell you for sure...until next monday when I'll ask my coworker. But I've heard them talk about FTP so it should be it. – Ben Lefebvre Aug 10 '12 at 15:57

1 Answers1

1

You have several options:

  • create a "service" for this , a kind of API so you can call this service from your client in different languages include ObjectiveC like http://myserver.com/myobject/set?tempset=1 (in real world, use post and not get for this)

    of course, to do this you need to write some server part in your favorite language

  • provide a way to upload the file and replace it completely, a kind of "upload.php"

Which solution is the best depends on your problem: how this file is generated and maintened

tomsoft
  • 4,448
  • 5
  • 28
  • 35