Sample code for core data on ios.