iphone - Adding components to path - Objective C -


i have url : www.gmail.com/index.php. have 3 different strings aa, bb , cc. want append 3 separate strings url in order combined url in objective c i.e want www.gmail.com/index.php/aa/bb/cc . can me out ?? new objective c. thanks.

if trying use url later use in retrieving data, etc., you're going want nsurl object when you're done. can create url appending @"/%@" next element, should @ doing following:

nsurl *originalurl = [nsurl urlwithstring: @"http://www.gmail.com/"]; nsurl *aanexturl = [originalurl urlbyappendingpathcomponent: @"aa"]; nsurl *bbnexturl = [aanexturl urlbyappendingpathcomponent: @"bb"]; nsurl *ccnexturl = [bbnexturl urlbyappendingpathcomponent: @"cc"]; 

this bit long-winded if adding static path elements, if adding computed information solves problem of making sure there appropriate slashes , allows use url construct directly.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -