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:
use standard string formatting function concatenate 2 pieces together...
[nsstring stringwithformat:@"%@?%@",sitestring,strdate]
Comments
Post a Comment