iOS database third-party framework Fmdb Learning notes

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.