I have an app that calls to a server and gets a long string of data returned. The data is a list of addresses as in the example here:
2133664:American Taxi Dispatch, Inc:Mount Prospect:834 E RAND RD|2133665:Walmart:Mount Prospect:930 Mount Prospect Plaza|
The data is, a unique identifier, The title, the city, and the street address.
I need to first know how to traverse this data so that I can separate the identifier, title, city and street. I am also looking for a recommended data structure that I can use to tie all the information together. I will be adding the titles to a NSMutableArray so I can display them in a UIPickerView. Then the user will need to select one and the entire address must be returned.
As far as I can see you’re data is separated by
:, what you need to do is to split each line on this character:You can use these components to build an object with fields for entryId, name, address. When displaying the item you use name, and when the item is selected you access the address field.