mapkit和表视图示例代码 - iPhone SDK [英] mapkit and table view sample code - iPhone SDK

查看:158
本文介绍了mapkit和表视图示例代码 - iPhone SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜遍了所有的东西,并且一直在尝试几个星期(甚至买了几本书......闻所未闻)来实现一个分段控制工作,该工作允许在mapview和tableview之间切换。基本上我使用来自xml的分析数据来获取商店的位置(比如交易者乔),并且我能够成功地将位置映射到mapview。但我不知道如何将解析的数据传递给tableview。我很沮丧,因为这似乎是一个相对流行的基于位置的应用程序的设计。



任何示例代码,链接,建议阅读,教程都将不胜感激。



/ p>

j

解决方案

听起来像这个问题与UISegmentedControl无关,的MKMapView?你只有填充UITableView的问题?如果是这样的话,您可以在iPhone开发者门户网站查看苹果的UITableView示例代码。网上快速搜索让我知道这个 http://www.icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/ ,我认为这是相关的。

在将地图显示在地图视图中之前,您可能已将XML粘贴到数组中,因此您应该可以使用相同的数组来填充UITableView


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 successfully. 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

解决方案

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

这篇关于mapkit和表视图示例代码 - iPhone SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆