我以編程方式在Xcode 4的iPhone應用程序中以編程方式創建了我的數據庫。我也插入到數據庫中並從中選擇所需的值。一切似乎工作正常,但我想檢查值是否重複或不。我無法在Xcode中打開我的數據庫文件,那麼有沒有辦法打開數據庫並檢查其中的值?在iPhone模擬器中查看sqlite3數據庫
0
A
回答
1
我可以建議使用Mozilla Firefox的SQLite插件。
https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
4
有兩種方法可以做到這一點: -
1)使用SQLite經理Firefox瀏覽器,然後工具 - >源碼管理器 - >打開數據庫
現在你可以運行查詢
select * from tablename; 您現在可以手動檢查重複值。
鏈接安裝SQLite的經理
https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
2)如果您想通過數據庫來檢查重複值
-(NSMutableArray *) readFromDatabase:(NSString *)query{
// Setup the database object
sqlite3 *database;
// Init the animals Array
MutableArray = [[NSMutableArray alloc] init];
NSString *readCommand=query;
//readCommand=[readCommand stringByAppendingFormat:@"%@';",patientID];
// Open the database from the users filessytem
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) {
// Setup the SQL Statement and compile it for faster access
const char *sqlStatement = [readCommand UTF8String];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
// Read the data from the result row
[MutableArray addObject:[NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]];
}
}
// Release the compiled statement from memory
sqlite3_finalize(compiledStatement);
}
sqlite3_close(database);
return MutableArray;
}
調用這個函數。並檢查返回的數組值。
相關問題
- 1. iPhone模擬器上存儲的sqlite3數據庫在哪裏?
- 2. 在sqlite3中查看我的數據庫
- 3. 如何查看android模擬器的sqlite數據庫?
- 4. 如何查看django sqlite3的數據庫和模式db
- 5. 在Android模擬器中無法從我的數據庫中查看錶格
- 6. 在iphone模擬器中打開sqlite數據庫文件?
- 7. SQLite3數據庫打開,但不顯示Android模擬器中的表數據
- 8. 如何在iphone中查看聯繫人模擬器
- 9. 在SQLite3中查看
- 10. 在ios模擬器中查看Console.log
- 11. iPad模擬器查看
- 12. 數據庫存儲在iPhone模擬器(Mac OS)?
- 13. 查看屏幕上只出現在iPad和iPhone 6.1模擬器
- 14. 查看存儲模擬器中的SQL Azure數據庫的內容
- 15. iPhone模擬器不看我的NSString類
- 16. iPhone核心數據模擬器
- 17. iPhone模擬器問題刪除數據
- 18. iphone-sqlite3數據庫鎖定異常
- 19. iPhone + sqlite3 +不在查詢中
- 20. 我怎樣才能看到SQLite數據庫(無模擬器)?
- 21. 模擬/模擬postgresql中的重負載數據庫服務器
- 22. 在sqlite3數據庫中插入數據
- 23. iPhone模擬器改變我的數據庫有時
- 24. 哪裏的iPhone模擬器保存sqllite數據庫
- 25. 如何模擬在iPhone模擬器
- 26. iPhone模擬器 - 留下appium查看按鈕
- 27. 在iPhone中的sqlite3數據庫中搜索
- 28. 我看不到在iphone模擬器中播放的電影
- 29. 烘烤工具無法在SQLite3數據庫中看到表格
- 30. [Python] [sqlite3]如果語句看到值是否在數據庫中?
好吧,現在我發現了一個很棒的帖子 - http://stackoverflow.com/questions/100959/mac-sqlite-editor – beryllium