简体   繁体   English

iPhone-在标签栏中的视图之间传递数据

[英]iPhone--passing data between views in tabbar

I am writing an Tab-Based iPhone application (3.1.2). 我正在编写基于选项卡的iPhone应用程序(3.1.2)。 The purpose of this application is to gather and process data from the GPS, accelerometer, etc. from one view, and then, once data collection has finished, pass this data to another view in order to graph the values. 此应用程序的目的是从一个视图收集和处理来自GPS,加速度计等的数据,然后,在数据收集完成后,将此数据传递到另一个视图以绘制值。 What is the best way to pass this data? 传递此数据的最佳方法是什么? Would it make sense to use SQLite or CoreData, or is there some other more expedient method? 使用SQLite或CoreData是否有意义,或者是否还有其他更方便的方法? The graphing and data collection both work separately, but I am at a loss for how to pass the values between the two. 图形和数据收集都分别工作,但是我对如何在两者之间传递值感到困惑。 I have read that this is frowned upon, but can I reference the instance of the graphing viewcontroller from the application's UITabBarController in order to pass the data? 我已经读过这是不满意的,但是我可以从应用程序的UITabBarController引用图形viewcontroller的实例以传递数据吗?

Thanks, 谢谢,

James 詹姆士

does your graphing viewcontroller show a graph of the most recent data? 您的图形视图控制器是否显示最新数据的图形? In that case you might not have to pass it anything. 在这种情况下,您可能不必传递任何内容。 It can simply open te database and ask for the latest data. 它可以简单地打开数据库并索取最新数据。 Your collecting view does the reverse, it opens the database and inserts data. 您的收集视图执行相反的操作,它将打开数据库并插入数据。

So no connection between the views. 因此视图之间没有任何联系。 They both simply work on the database directly. 它们都直接在数据库上直接工作。

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

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