Questions tagged [fmdb]

FMDB is a free, third-party Objective-C wrapper for SQLite, providing a simple, object-oriented interface for Mac OS X and iOS.

FMDB is a free, third-party Objective-C wrapper for SQLite, providing a simple, object-oriented interface for Mac OS X and iOS. FMDB isolates the Objective-C developer from the SQLite C interface and greatly simplifies the process of writing code that interacts with SQLite databases.

FMDB was developed by August "Gus" Mueller and is provided the public free of charge for use without restriction. See the LICENSE.

References

678 questions
6
votes
1 answer

When to close SQLite database (using FMDB)

When should you close the connection to an SQLite database (using [db close] in FMDB)? Right now I am closing it after running every batch of related queries, but should I rather close when my app closes? What are the pros/cons of doing either…
Souleiman
  • 3,065
  • 3
  • 17
  • 21
5
votes
1 answer

va_args() causing EXC_BAD_ACCESS

I'm getting a EXC_BAD_ACCESS when using va_args (iOS 7, Xcode 5.1.1, ARC on): // ... int val = sqlIntQuery(@"format_string", @"arg1"); // <-- does not work int val = sqlIntQuery(@"format_string", @"arg1", nil); // <-- this works //…
Jeff
  • 2,395
  • 20
  • 39
5
votes
2 answers

FMDB: is It good remaininig open database during the whole life cycle of ios app?

I am confused about database open and close operation for FMDB wrapper class. Is it creating issue if i open database in applicationDidFinishLoading method of AppDelegate class and do not close until application will terminate ? Thanks.
Nikh1414
  • 1,212
  • 1
  • 18
  • 35
5
votes
4 answers

Is there a tutorial about how to use FMDB, the sqlite3 wrapper class?

The FMDB page just offers the cvs checkout. Maybe someone out there wrote a good tutorial on how to use FMDB with sqlite3 on the iphone?
HelloMoon
5
votes
1 answer

Keeping FMDB thread safe

I see in FMDB 2.0, the author added FMDatabaseQueue for threads. The example is: // First, make your queue. FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath]; Then use it like so: [queue inDatabase:^(FMDatabase *db) { [db…
Crystal
  • 25,222
  • 53
  • 203
  • 370
5
votes
1 answer

How can I use FMDB as a Framework in an iPad application?

I am currently developing an iPad application. At one stage, there is a series of sliders and buttons, when you press the button, it stores the value of the slider into a table. First of all, I need to use SQLite to manage the database. I found a…
Tristan
  • 65
  • 2
  • 8
5
votes
2 answers

sqlite3 and fmdb nested FMResultSet is possible?

I'm trying to iterator through a master detail sort of tables and I'd like to populate the master/detail structures as I go. Apparently when I nest result sets I get a BAD Access exception: FMDatabase *db = self.database; [db…
4
votes
2 answers

how can I read the whole row data from SQLite with FMDB in IOS dev?

I can read all column Data from code like this ... FMResultSet *rs = [db executeQuery:@"SELECT Name, Age, FROM PersonList"]; while ([rs next]) { NSString *name = [rs stringForColumn:@"Name"]; int age = [rs intForColumn:@"Age"]; } or find some…
bbbbbird1
  • 59
  • 2
  • 6
4
votes
2 answers

Convert FMResultSet to NSMutableArray?

I am trying out FMDB and it looks like it will work perfectly for me IF I can get my FMResultSet turned into an NSMutableArray. How would I accomplish this?
Slee
  • 24,982
  • 48
  • 139
  • 237
4
votes
2 answers

FMDB executeUpdate DROP command does halt the app

I want to drop a table in my SQLite Database file named database.db. After using NSLog(@"i show up in the console"); [db executeUpdate:@"DROP TABLE IF EXISTS `article`;"]; NSLog(@"i will not show up in the console"); the app stops at the position…
TRD
  • 1,027
  • 10
  • 20
4
votes
1 answer

sections and index in UITableView from Sqlite (FMDB)

I am trying to get the sections and index for UITableView from Sqlite (I am using FMDB as the wrapper). I just can't seem to figure out where to start. I can read the information back from the DB and store it in a NSMutableArray. I have tried the…
Mush
  • 185
  • 1
  • 2
  • 11
4
votes
2 answers

"Apple Mach-O (id) linker" error when adding external libraries to project

I added FMDB to my project then added the frameworks libsqlite3.dylib and libsqlite3.0.dylib, but I still get the build error. If I remove the FMDB classes from my project then it builds just fine. What other things should I check? Detailed info on…
user810606
4
votes
2 answers

Problem with FMDB and insert value in the "executeQuery:" from a searchString

While building a Search for my app i ran into a problem whilst using the FMDB SQLite Wrapper (https://github.com/ccgus/fmdb). When I search my database with this SQL Command, everything is fine. 13 objects are returned and I can use…
Steven David
  • 704
  • 7
  • 14
4
votes
1 answer

How do I make FMDB's database a singleton

I have been using SQLite for awhile now, and have decided to go to FMDB. I need to make it a singleton. Here's my code below; what do I have to change to have FMDB access the singleton d/b? #pragma mark Singleton Methods + (SQLiteDB *)…
SpokaneDude
  • 4,576
  • 11
  • 61
  • 116
4
votes
0 answers

XCcode9.3/iOS11.3 fmdb/sqlite will be crash

XCcode9.3 run project when First time In Debug, fmdb/sqlite crashes most of the time. some info is: "BUG IN CLIENT OF sqlite3.dylib: illegal multi-threaded access to database connection" Did some changes for iOS11.3?
lauren1573
  • 271
  • 1
  • 2
  • 4
1 2
3
45 46