简体   繁体   English

mapkit和表格视图示例代码-iPhone SDK

[英]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. 我进行了全面搜索,现在已经尝试了几个星期(甚至买了几本书……闻所未闻),以进行分段控制工作,从而可以在mapview和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 successfully. 基本上,我使用的是从xml解析的数据来获取商店的位置(例如交易员乔斯),而且我能够将位置成功地放入mapview。 But I've no idea how to pass the parsed data to a tableview. 但是我不知道如何将解析后的数据传递给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. 在github上有一个项目,项目具有从单个NSDictionary填充的mapview和table view。 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. 该项目不是完整的XCode项目,但是您应该能够使其适应您的需求。

Sounds like the question is not related to UISegmentedControl and MKMapView? 听起来这个问题与UISegmentedControl和MKMapView不相关吗? You just have problem populating a UITableView? 您只是在填充UITableView时遇到问题? If that is the case, you can just check out Apple's sample code for UITableView at iPhone developer portal. 如果是这种情况,您可以在iPhone开发人员门户上查看Apple的UITableView示例代码。 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. 在线快速搜索可以让我获得这个http://www.icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/的信息 ,我认为这很重要。

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 而且,您可能会将XML粘贴到数组中,然后再在地图视图中显示它,因此您应该能够使用相同的数组来填充UITableView

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM