title: xCode substituting part of a URL when using NSURL
body: <p>I am working on an app that connects to a web site using NSURL......</p>
  
  <p>When the app load it looks up a record from the MySQL server and returns data if a record is found, this works. It passes the data back to the app using json, this works.</p>
  
  <p>The data returned forms a part of the URL I want to use to load the web view.</p>
  
  <p>The code I have so far is:</p>
  
  <pre><code>NSString *RoomID = [NSString stringWithFormat:@"%d",roomid];
  
  NSURL url = [NSURL URLWithString:@"http://example.com/apps/conf/lhr/location/devices/d1/template.php"];
  NSURLRequest *request = [NSURLRequest requestWithURL:url];
  [webView loadRequest:request];
  </code></pre>
  
  <p>What I would like to to is substitute </p>
  
  <p>/location/devices/d1/template.php</p>
  
  <p>/location/devices/... the <strong>RoomID</strong>.../template.php</p>
  
  <p>After reading lots of posts I just can't workout how to do this. Any help would be great.</p>
  
  <p>Regards,</p>
  
  <p>DCJ</p>