Ios read and write database example