Here is some simple code that allows you to validate email addresses that have been entered by a user on an iPhone. It does use NSPredicate, which is only available on OS 3.0 and above;
After creating a new version of your data model, and adding the relevant code to handle lightweight migration, to actually get your code to run ensure that you do a clean all targets otherwise you get merge model errors!
This Firefox add-on allows you to view the data you are running against while using the iPhone simulator. Your sqlite files can be found in the following folder
When you alter your underlying data model the iPhone simulator will not be able to load your app as the cached version of the database doesn’t match the new one. The easiest way to resolve the problem is to run the simulator, click and hold your app and remove it like you would remove an app from your actual phone.
Once you’ve created your data model within Xcode, you may need to generate the classes so that you can use and reference them in your main project. To do this open the data model, select File/New File… from the Xcode menu system, this will display the following screen…
New File screen with Managed Object Class selected
Choose your location and then select the entities you want created.