- init
{
if(![super init]) return nil;
//the database is stored in the application bundle.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingFormat:@"/base.sql...
Coming from a non-SQL background, I've been having a hard time absorbing SQLite3 for the past few days. Has anyone had any good results using any of the SQLite3 wrapper APIs out there? Do they work reliably? Which is best? I am also hearing buzz about Core Data coming to the iPhone. Not sure whether that info is trustworthy or not but ma...
Hi !
I use FMDB to wrap SQLite in my app. I haven't found any docs about the use of methods begin, beginUpdates, commit, finalize, etc. I face some problems in my apps which i think are caused by the way i use transactions.
Here is what i tried :
[FMDB beginUpdates]
- My insert statement -
[FMDB commit]
[FMDB finalize]
it crashes wi...
Hi,
I'm trying to do some Unit Testing on method that includes SQL call wrapped by FMDB. I get a lot of linker errors when i try to build the project such as these ones :
"_sqlite3_step", referenced from:
-[FMResultSet next] in FMResultSet.o
-[FMDatabase executeUpdate:arguments:] in FMDatabase.o
"_sqlite3_column_name", ...
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?
...
FMDB runs great in the simulator, but I get the following errors when I try to run it on the device.
"_sqlite3_step", referenced from:
-[FMResultSet next] in FMResultSet.o
-[FMDatabase executeUpdate:arguments:] in FMDatabase.o
"_sqlite3_column_name", referenced from:
-[FMResultSet setupColumnNames] in FMResultSet.o
...
I am using fmdb for managing my database. I could not find any example for deleting a row from a table in fmdb. I tried
NSString *sqlStat=@"DELETE from tableName WHERE id=3";
FMResultSet *rs = [database executeQuery:sqlStat];
but its not working because when I checked the total number of entries in table, I am getting the sam...
I'm sure this is very easy but I'm trying to get the fmdb sqlite wrapper to work in an iPhone project. I've grabbed the files via SVN, and there are 'h' and 'm' files inside an 'src' folder.
I'd assumed that if I right-click the Classes folder and select Add > Existing Files... that would work.
But when I try to compile I get an error...
I'm pulling and pushing data from an sqlite database. I use the FMDatabase cocoa wrapper.
I'm pulling and pushing data from multiple threads, but I made sure that more then one transactions never happen at the same time.
I get EXC_BAD_ACCESS after a few hundred call at the database but never at the same time. It's also not memory rela...
Hello,
I am using FMDB to deal with my database which works fine. The app uses a background thread which is doing some work and needs to access the database. At the same time the main thread needs to run some quieries on the same database. FMDB itself has a little locking system, however, I added another to my classes.
Every query is o...
Hi i am using FMDB to retrieve data from SQLITE database.
db = [[FMDatabase alloc] initWithPath:path];
[db open];
FMResultSet *fResult= [db executeQuery:@"SELECT * FROM Users"];
aUsers = [[NSMutableArray alloc] init];
while([fResult next])
{
userData = [fResult stringForColumn:@"Name"];
lblUsers.text=[lblUsers.text...
If I was adding data from an array to the UITableView datasource array I'd use this, in viewDidLoad.
NSMutableArray *array = [[NSArray alloc] initWithObjects:@"Head First Design Patterns", @"Head First HTML & CSS", @"Head First iPhone", nil];
self.transactionsArray = array;
[array release];
And this in cellForRowAtIndexPath
NSInteger...
Hiyas
does anyone know how to return the count of a query when using FMDB? If I executeQuery @"select count(*) from sometable were..." I get an empty FMResultSet back. How can I get the row count of the query? Do I need to do a query like "select * from sometable where.." and iterate through the result set? Or can I use useCount or what...
Hi, I'm trying to open a database that I have in my project inside Resources.
The problem is that it seems that its impossible to find the database file!
I tried with the complete path, and it works, but this is not a good solution.
I would like to now how to open it!
I'm using this code:
db = [FMDatabase databaseWithPath:@"bbdd.sql"]...
I am using FMDB in my app to do some updates in my DB. Problem is when I update my table with executeUpdate function, it update my table BUT if I copy the same .sqlite file from project to at another place in my drive and try to query using terminal, it shows that database is not updated, why it is so?
...
In UITableView, I want to delete a row and remove that row on database, but my query of sqlite don't works.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
UIAlertView *view;
...