I am planning to start an iPad app...
我打算开一个iPad应用......
In my app there will be 3 UITabels connected to SQLite3. How can i connect all the 3 tables together and control the data in tables with each other?
在我的应用程序中,将有3个UITabel连接到SQLite3。如何将所有3个表连接在一起并相互控制表中的数据?
For Example
例如
IF I have 3 tables
Tabel 1: Name;
Tabel2: Country;
Tabel3: Gender;
The table name displays a large data of different name. suppose if a select a name called Alex . the other name should disappear from the list and in the Country table should list only the country name related to Alex(if there is no Alex in China, then China should not appear). the Gender table should only list Male.
表名显示不同名称的大数据。假设选择一个名为Alex的名称。另一个名称应该从列表中消失,并且在Country表中应该只列出与Alex相关的国家名称(如果在中国没有Alex,那么中国就不应该出现)。性别表应该只列出男性。
In the same way if i Select USA. the other name Country table should disappear and should list only related names in name list. same thing for Gender table too.
如果我选择美国同样的方式。另一个名称Country table应该消失,并且应该只列出名单中的相关名称。性别表也一样。
Can any one give me some ideas or Suggestions please.
任何人都可以给我一些想法或建议。
Any examples or Links are highly appreciated.
任何示例或链接都非常感谢。
2 个解决方案
#1
0
While you can implement such behavior manually by using the UITableViewDelegate
and UITableViewDataSource
protocols, this seems like the perfect example to use CoreData
instead of manually building complex models.
虽然您可以通过使用UITableViewDelegate和UITableViewDataSource协议手动实现此类行为,但这似乎是使用CoreData而不是手动构建复杂模型的完美示例。
CoreData is a technology developed by apple to simplify the creation of apps that rely on such relatively simple data relationships.
CoreData是Apple开发的一种技术,用于简化依赖于这种相对简单的数据关系的应用程序的创建。
http://developer.apple.com/library/ios/#DOCUMENTATION/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html
#2
0
There's nothing like connecting to sqlite.you just have to create a sqlite db ..store your details and access it .If any store action is performed just send a message to classes holding the tableview to update their rows.I assume you are aware of UItableview its delegate methods , datasource etc.
没有什么比连接到sqlite.you只需创建一个sqlite db ..存储您的详细信息并访问它。如果执行任何存储操作,只需向持有tableview的类发送消息以更新其行。我假设您知道UItable查看其委托方法,数据源等。
[table reloaddata];
iF TABLES ARE IN SAME VIEWCONTROLLER , YOU ALREADY know that changes have been made and you can reload the tables with by extracting data from sqlite.
iF表格在同一个视图控制器中,您已经知道已经进行了更改,您可以通过从sqlite中提取数据来重新加载表格。
To make your job simple and easy yOu can use FMDB as sqlite wrapper.
为了使您的工作简单易行,您可以使用FMDB作为sqlite包装器。
Sqlite教程
Wnderlich的Sqlite教程
you can use splitebrowser plugin for firefox to see the sqlitedb
你可以使用splitebrowser插件为firefox查看sqlitedb
#1
0
While you can implement such behavior manually by using the UITableViewDelegate
and UITableViewDataSource
protocols, this seems like the perfect example to use CoreData
instead of manually building complex models.
虽然您可以通过使用UITableViewDelegate和UITableViewDataSource协议手动实现此类行为,但这似乎是使用CoreData而不是手动构建复杂模型的完美示例。
CoreData is a technology developed by apple to simplify the creation of apps that rely on such relatively simple data relationships.
CoreData是Apple开发的一种技术,用于简化依赖于这种相对简单的数据关系的应用程序的创建。
http://developer.apple.com/library/ios/#DOCUMENTATION/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html
#2
0
There's nothing like connecting to sqlite.you just have to create a sqlite db ..store your details and access it .If any store action is performed just send a message to classes holding the tableview to update their rows.I assume you are aware of UItableview its delegate methods , datasource etc.
没有什么比连接到sqlite.you只需创建一个sqlite db ..存储您的详细信息并访问它。如果执行任何存储操作,只需向持有tableview的类发送消息以更新其行。我假设您知道UItable查看其委托方法,数据源等。
[table reloaddata];
iF TABLES ARE IN SAME VIEWCONTROLLER , YOU ALREADY know that changes have been made and you can reload the tables with by extracting data from sqlite.
iF表格在同一个视图控制器中,您已经知道已经进行了更改,您可以通过从sqlite中提取数据来重新加载表格。
To make your job simple and easy yOu can use FMDB as sqlite wrapper.
为了使您的工作简单易行,您可以使用FMDB作为sqlite包装器。
Sqlite教程
Wnderlich的Sqlite教程
you can use splitebrowser plugin for firefox to see the sqlitedb
你可以使用splitebrowser插件为firefox查看sqlitedb