0

I've created this method in my iOS to call to FMDatabaseQueue:

-(void) enqueueSelectStatement:(NSString*)selectStatement withArguments:(NSArray*)args {
            
    NSLog(@"Checkpoint 1");
            
            
    [self.dbQueue inDatabase:^(FMDatabase *db) {
                   
        FMResultSet *result = [db executeQuery:selectStatement withArgumentsInArray:args];
                    
        NSLog(@"Checkpoint 2");

    }];
            
                
    NSLog(@"Checkpoint 3");
           
}

When I call this method with:

NSString *query = @"SELECT * FROM mytable WHERE id = ?";

[self enqueueSelectStatement:query withArguments:@[1]];

I get Checkpoint 1 in my terminal output, but nothing else. The app does not crash and continues to run, but the method/block apparently dies after Checkpoint 1

Is the method just stopping, and if so, why?

Community
  • 1
  • 1
Chris
  • 5,485
  • 15
  • 68
  • 130
  • please provide the crash log. – Priyatham51 Nov 21 '14 at 00:40
  • "but apparently dies after Checkpoint 1". Is it printing anything to the log ? – Priyatham51 Nov 21 '14 at 00:46
  • 2
    You state *"The app does not crash"* and *"but apparently dies"*. Those two statements contradict each other. Does it crash or not? – rmaddy Nov 21 '14 at 00:48
  • Edited : The app does not crash, but the method apparently dies – Chris Nov 21 '14 at 00:59
  • Methods don't die. The method can get stuck or the app crashes but a method doesn't just die. Use the debugger and step into the code and see what happens. – rmaddy Nov 21 '14 at 01:10
  • Set a breakpoint after checkpoint 1, and then print out a stack trace. I bet you either have another thread blocking on a statement… or maybe an open result set. – ccgus Nov 22 '14 at 22:58

0 Answers0