title: objective-c: Extremely Strange and annoying string problem
body: <p>i've been working on a tableview program and i have a function that processes several data from user preferences, and core-data. the program parses these things and returns a url adress. heres the code:</p>
  
  <pre><code>    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
   NSString *serverAdress = [prefs stringForKey:@"serverAdress"];
   serverAdress = [serverAdress stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
  
   NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
   [dateFormatter setDateFormat:@"dd.MM.yyyy"];
  
   NSDateFormatter *dateFormatter2 = [[NSDateFormatter alloc] init];
   [dateFormatter2 setDateFormat:@"dd.MM.yyyy HH:mm"];
  
   NSString *dateString = [dateFormatter stringFromDate:[NSDate date]];
  
   NSString *dateTimeString = [NSString stringWithFormat:@"%@ %@",dateString,[dashboardParameters attribute1]];
  
   NSTimeInterval dayInterval = [[dashboardParameters attribute2] intValue]*60*60*(-1);
   NSDate *date2 = [[dateFormatter2 dateFromString:dateTimeString] addTimeInterval:dayInterval];
   NSString *urlString = 
   [NSMutableString stringWithFormat:@"%@/webservices/service1.asmx/getHourlySales2?tarih2=%@&amp;tarih1=%@&amp;salesType=%@",
    serverAdress,
    dateTimeString,
    [dateFormatter2 stringFromDate:date2],
    [dashboardParameters itemOrder]
    ];
   urlString = [urlString stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; 
   return urlString;
  </code></pre>
  
  <p>Everything works great, i have no problem on retrieving data. But when i execute the code, i get this log output: </p>
  
  <blockquote>
    <p>//server.dyndns.org/webservices/service1.asmx/getHourlySales2?tarih2=20.01.2011%2016:00&amp;tarih1=19.01.2011%2016:00&amp;salesType=Hepsi/webservices/service1.asmx/getHourlySales2?tarih2=21.01.2011%2022:00&amp;tarih1=21.01.2011%2011:00&amp;salesType=Hepsi</p>
  </blockquote>
  
  <p>it has to be </p>
  
  <blockquote>
    <p>//server.dyndns.org/webservices/service1.asmx/getHourlySales2?tarih2=20.01.2011%2016:00&amp;tarih1=19.01.2011%2016:00&amp;salesType=Hepsi</p>
  </blockquote>
  
  <p>But strangely the program adds </p>
  
  <blockquote>
    <p>/webservices/service1.asmx/getHourlySales2?tarih2=21.01.2011%2022:00&amp;tarih1=21.01.2011%2011:00&amp;salesType=Hepsi</p>
  </blockquote>
  
  <p>by itself after the normal processing. </p>
  
  <p>Also another important thing, the code runs normally when i remove </p>
  
  <p><code>NSString *serverAdress = [prefs stringForKey:@"serverAdress"]</code> from the code and enter serveradress manually. </p>
  
  <p>Plase help , everything in the program works fine but im stuck with this problem. </p>
  
  <p>Thanks for helping.</p>