View images of ios_sqlite Databases

Source: Internet
Author: User
Tags sqlite manager

Problem description: when using the sqlite database in xocde, because there is no graphical interface, sometimes it is difficult to see whether there is a problem with your own database, for example, when I was just getting started with the sqlite Database Design id, I naturally used identify () (in fact, I should use primary key autoincrement). Finally, I can imagine that the id will never be assigned a value, however, it cannot be found at first.

Solution:

Method 1: Firefox browser has a plug-in called sqlite manager, many people like to use this plug-in: https://addons.mozilla.org/zh-CN/firefox/addon/sqlite-manager/

After installation, find and open it in Firefox's tool:

 

.

If you do not know the address of the database file, use the code to obtain the file path:

- (NSString **paths =*documentsDir = [paths objectAtIndex: [documentsDir stringByAppendingFormat:

 

You can use the NSLog function to output the file path, select the file path (note that the file path does not include the database name), and right-click it to open it:

 

You can also use a terminal (of course this method is somewhat complicated), because with the file path, it is easy to copy the database file to the desktop. Command Line: cp-R source file path/Users/aj/Desktop

Note that some folders have spaces, such as/iPhone Simulator. If you copy the obtained path directly as the source file path to the folder, the error "No such file or directory" is returned ". Remember to escape the space by adding a single quotation mark (') at both ends of the space, for example,/iPhone ''' Simulator.

 

Method 2:

Download SQLiteManager. This method is very easy to open the database in the project. It does not need to be as tedious as the first method. Select the output path (note that this time is the path + "database. sqlite ") directly Services --" Open ", because SQLiteManager is already the default program to Open the database.

 

 

 

 

Related Article

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.