In the plant Diary app, the SQLite3 is used for data storage, and in order to simplify the code, the Fmdb framework is used for database operations. A few points to note:
The distinction between 1.executeQuery and executeupdate
In addition to the select operation using ExecuteQuery, other operations are executeupdata.
2. Database read and write pictures
you must first convert the image to the NSData type before storing it. NSData *data = uiimagejpegrepresentation (image, 1);
Need to convert when reading [UIImage Imagewithdata:data];
3. Note the type of data stored in the database
Today, the direct use of the Nsinteger type into the database crash, with [NSNumber Numberwithint:] Conversion After the deposit is no problem.
One of the challenges of this afternoon's programming process is the method problem of Navigationbar's return key call. I want to notify the previous page to refresh the data when you press the Back button to return to the previous page. But there's no way to find it. The system comes with a "back" button that does not seem to have a method called. Google a bit, and also checked the answer on the StackOverflow, found as if there are two solutions: 1. Customize a return button, write a method, 2. Write a method on Viewwillappear. Feeling is not perfect, continue to find the answer.
The first blog, hope to persist, refueling.
iOS database third-party framework Fmdb Learning notes