objective c - Adding time to url address -


i try add time informations url address.

example:

http://www.test.de/output/iphone.txt?%y%m%d%h%m%s

like this.

this first try:

first tried recieve current time:

    nsdate *currentdate = [nsdate date]; //  aktuelles datum und die uhrzeit     nsstring *strdate =  [[currentdate                            datewithcalendarformat:@"%y%m%d%h%m%s" timezone:nil]  description];  +     nsstring *sitestring = @"http://www.test.de/output/iphone.txt"; nsurl *siteurl  = [nsurl urlwithstring:sitestring];                 nsstring *mystring = [nsstring stringwithcontentsofurl:siteurl encoding:nsasciistringencoding error:&error]; 

now have 2 variables, strdate , sitestring. want combine these strings, @ end want have following string:

nsstring *link = [sitestring "+" ? "+" strdate] 

that string should like:

http://www.test.de/output/iphone.txt?yyyymmddhhmmss

use standard string formatting function concatenate 2 pieces together...

   [nsstring stringwithformat:@"%@?%@",sitestring,strdate] 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -