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

677 questions
3
votes
2 answers

SQLITE (fmdb) select where x is null not working

I'm using FMDB on iOS, attempting to query a table with a statement such as, select * from test where foo isNull In the sqlite C API, this ends up binding to null using this API, int sqlite3_bind_null(sqlite3_stmt*, int); This isn't working. The…
David
  • 2,770
  • 5
  • 35
  • 43
3
votes
1 answer

FMDB lastinsertRowID always 0

Hya. I have implemented FMDB in my app. I am trying to get the last row id from one of my databases with this FMDatabase *bdb=[FMDatabase databaseWithPath:databasePath]; NSString *str; if([bdb open]){ int lastId=[bdb…
s.calin
  • 83
  • 1
  • 9
3
votes
1 answer

DB wrapper library for SQLite for iOS development

I am a beginner iOS developer and looking for a easy to use database wrapper library to use SQLite in iOS (Iphone, Ipad) applications. So far, I have found FMDB. What do you guys use to make enterprise wide Iphone database application? What is an…
dotnet-practitioner
  • 13,968
  • 36
  • 127
  • 200
3
votes
1 answer

semaphore_wait_trap, GCD and CocoaAsyncSocket

I am currently building an App using CocoaAsyncSocket. I connect to a TCP server and read/write some data. I create the socket using self.socket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; When data is…
3
votes
3 answers

FMDB EXC_BAD_ACCESS when inserts to database

Im getting this error when im trying to insert something in my database: The strange thing is, that the error only occurs when there is about 12-14 previus records in the table that im inserting to. Anyone that knows how to solve this? Here is my…
ebsp
  • 183
  • 1
  • 2
  • 8
3
votes
2 answers

How Can I Save & Retrieve an image (bytes) to SQLite (blob) using FMDB?

I'm making an iOS App that need to show some images from a remote site (from an URL), and everytime the users enter to the screen that should show the image, the app get freeze until the download is completed. So I want to store the images already…
Alberto Estrella
  • 671
  • 9
  • 19
3
votes
2 answers

iOS - FMDB database insert

To insert data into a database using sqlite requires copying of the database to make it writable. So I have this method in my class which every suggestion I've seen over stack overflow and many other…
ruelluna
  • 787
  • 1
  • 11
  • 30
2
votes
2 answers

How do I get an NSString out of a block?

I've really been trying, but I am just not getting blocks very well. I am in the process of using the FMDatabaseQueue, and I am trying to make a very simple queue based query. This is what I have: -(NSString *) getReferenceForPage:(NSInteger)…
Lizza
  • 2,769
  • 5
  • 39
  • 72
2
votes
2 answers

I can't trap FMDB empty resultset

I am having trouble trapping an empty result set from FMDB. The code is below. I am getting NSLog's from the database opening and closing and NSLog "1" but none of the ones in the If statement! If I have data in the database its fine, but I want to…
Darren
  • 10,182
  • 20
  • 95
  • 162
2
votes
3 answers

Loading 10k+ rows in iphone SQLite (FMDB)

I am creating a dictionary app and I am trying to load the terms into an iphone dictionary for use. The terms are defined from this table (SQLite): id -> INTEGER autoincrement PK termtext -> TEXT langid -> INT normalized -> TEXT Normalized is…
Panagiotis
  • 1,539
  • 1
  • 14
  • 28
2
votes
2 answers

iOS - FMDB usage and memory

I have been tracking down memory leaks in my iOS app and I keep coming back to the following code using the leaks instrument: NSMutableArray *resultSet = [[NSMutableArray alloc] initWithCapacity:3]; NSAutoreleasePool *innerPool =…
Crake
  • 1,661
  • 1
  • 13
  • 30
2
votes
1 answer

Possible FMDatabase/FMResultSet bug

Even though I rarely have problems with FMDatabase, I noticed some odd behavior today and was wondering if this is a bug or due to a mistake of my own. NSString *query = [NSString stringWithFormat:@"SELECT * FROM TABLE_A WHERE modelId = %lu",…
Bart Jacobs
  • 9,022
  • 7
  • 47
  • 88
2
votes
1 answer

FMDB with multithread problem

In my ios app, I use FMDB to connect to the sqlite3 db. In the app, db will be used in multithread.As a result, I create a singleton in this way: + (id)instance { static DBManager *dbManager = nil; if (dbManager == nil) { dbManager = [[DBManager…
scorpiozj
  • 2,687
  • 5
  • 34
  • 60
2
votes
1 answer

Using iCloud for app database backup, but not syncing

I'm seeking advice on using iCloud in a limited way. The docs are focused on syncing between multiple devices, which I do not need. When I say iCloud, I'm also including iCloud Drive, if that matters. My iPhone app stores its data and state in a…
Jeff
  • 2,659
  • 1
  • 22
  • 41
2
votes
0 answers

iOS - sqlite3 - random readonly errors

We have an enterprise app in production with several clients and this issue is only happening with one client and we've been unable to reproduce locally. Our crashlytics is showing random readonly errors - attempt to write a readonly database. It's…
triggs
  • 5,890
  • 3
  • 32
  • 31