¡@

Home 

2014/10/15 ¤U¤È 10:11:44

iphone Programming Glossary: mydatamodel

How does [self.tableView reloadData] know what data to reload?

http://stackoverflow.com/questions/2442395/how-does-self-tableview-reloaddata-know-what-data-to-reload

like you have data spread across two arrays so you would create a data model object something like this @interface MyDataModel NSObject @protected NSArray arrayOne NSArray arrayTwo @public NSArray currentlyUsedArray @property nonatomic retain NSArray.. retain NSArray currentlyUsedArray void switchToArrayOne void switchToArrayTwo void toggleUsedArray @end #import MyDataModel.h @interface MyDataModel @property nonatomic retain NSArray arrayOne @property nonatomic retain NSArray arrayTwo @end @implementation.. void switchToArrayOne void switchToArrayTwo void toggleUsedArray @end #import MyDataModel.h @interface MyDataModel @property nonatomic retain NSArray arrayOne @property nonatomic retain NSArray arrayTwo @end @implementation MyDataModel..

sqlite database update when app version changes on Appstore in iPhone

http://stackoverflow.com/questions/8794397/sqlite-database-update-when-app-version-changes-on-appstore-in-iphone

I use a Shared Data Instance. In the viewDidLoad I do the following test if first time run of this version if MyDataModel sharedInstance .count FirstTime 1 do what you need to do as the first time load for this version MyDataModel sharedInstance.. if MyDataModel sharedInstance .count FirstTime 1 do what you need to do as the first time load for this version MyDataModel sharedInstance .count save the count value to disk so on next run you are not first time this means count 1 Now the trick..