Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix validation error when POSTing a blog entry by setting lastModified value


Nothing fancy here. Now open and add the following method:

Code Block
	public void awakeFromInsertion(EOEditingContext editingContext) {
		NSTimestamp  this.setCreationDate(now = new NSTimestamp();

Why are we adding this? awakeFromInsertion is a very good way of setting default values when creating a new instance of a Enterprise Object (EO). In this case, we want to set automatically the creation date and last modification dates without having the user to add that valuethose values.

Now, let's use migrations to actually create the database.