added Core data example in AppDelegate.
minor changes make core data save in one method