Ios_sqlite database image view

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Description of the problem: when using SQLite database in xocde, because there is no graphical interface, sometimes it's hard to see their own design database if there are problems, for example, I just use SQLite ID database design for self growth, naturally with the identify (1,1), (in fact should use PRIMARY KEY autoincrement) finally, one can imagine the id always has no value, but a start in any case are not find.

Solution:

Method: the Firefox browser, a plug-in called SQLite manager, a lot of people like to use this plugin, download address:

After installation in the Firefox browser tools to find and open can:


Click

Select the suffix for the.Sqlite file.

If you don't know the address of the database files, code can access the file path:

- (NSString *)filePath{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    return [documentsDir stringByAppendingFormat:@"The name of the database.Sqlite"];
}

Use the NSLog function to the output file path, select the file path (note the file path does not include the database name), and then right-click to open:


Can also use the terminal (of course this method some complicated), because of the file path, it is easy to put the database files are copied to the desktop. Command line: CP – R source file path /Users/aj/Desktop

Note that, because some of the folder name spaces, such as /iPhone Simulator, will direct the path obtained above as a source file copy path to the terminal will appear error: “ No such file or directory”. Remember to put a space to escape in space, at both ends with single quotes “ ’ ” can be, for example/iPhone’ ‘Simulator.


Methods two:

Download SQLiteManager. This method opens the project in the database is very simple, do not like the first so tedious, path selected output (note that this is the path “.Sqlite&rdquo database;) Services-- "Open, because SQLiteManager is the default database open procedures.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Ingram at November 20, 2013 - 12:15 PM