Search code examples
iphoneiosasihttprequestfmdb

Application freezes with FMDB execute update query


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.


Solution

  • In AddJob.h

    Create

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

    And try accessing function .m file.