mapkit and table view sample code - iPhone SDK
I've searched all over and have been trying for a few weeks now (and even bought a few books.. unheard of) to have a segmented control work which allows for switching between the mapview and a tableview. Basically I'm using parsed data from xml to get the locations of stores (say trader joes) and I'm able to get the locations to come onto the mapview success开发者_开发问答fully. But I've no idea how to pass the parsed data to a tableview. I'm quite frustrated as this seems to be a relatively popular design for location based apps.
Any sample code, links, suggested reading, tutorials would be greatly appreciated.
Thanks in advance,
j
I have a project on github that has a mapview and a table view that are both populated from a single NSDictionary. I think that is what you want. The project is not a complete XCode project, but you should be able to adapt it to your needs.
Sounds like the question is not related to UISegmentedControl and MKMapView? You just have problem populating a UITableView? If that is the case, you can just check out Apple's sample code for UITableView at iPhone developer portal. A quick search online gets me this http://www.icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/ which I think is relevant.
And you are probably pasting your XML into an array before showing it in the map view, so you should be able to use the same array to populate UITableView
精彩评论