0

I am using FMDB wrapper class for database in my iphone app.

App freezes many times when i call a class with database execute update query.

Sample :

    BOOL success = [database executeUpdate:@"UPDATE JOBTABLE SET ST = ? WHERE jobid = ?",@"Accepted",[NSNumber numberWithInt:[jobIDStr intValue]]];

I am trying tested this by adding logs before and after this code. In console the line before its is printed, and then the app freezes.

I am calling function which includes this line of code from other class.

I had tried call this method using below code as well

Addjob *addjob=[[AddJob Alloc]init];
[addjob performSelectorInBackground:@selector(addJobHttpRequest) withObject:Nil];

This has also not worked for me. The function addjob contains the database update query.

4

2 回答 2

1

在 AddJob.h

创造

    Addjob *addjob=[[AddJob Alloc]init];

并尝试访问函数 .m 文件。

于 2013-05-31T09:30:10.143 回答
0

如果([数据库打开])

NSString *queryStr ;

    queryStr = [NSString stringWithFormat:@"Update yourTableName set DatabasefieldName = '%@' where serial=%i ",databaseFieldValue,serialValue intValue]];

    [db executeUpdate:queryStr];
于 2013-05-29T10:19:22.437 回答