SQLiteInstanceManager *manager = [SQLiteInstanceManager sharedManager];
int hourLimit = 36; //36 hours ago
double seconds = abs((hourLimit * 60 * 60));
NSDate *pastDate = [[NSDate date] addTimeInterval:seconds];
double pastDateInSeconds = [pastDate timeIntervalSince1970];
if ([manager tableExists:@"wave"])
[manager executeUpdateSQL:[NSString stringWithFormat:@"DELETE FROM
wave WHERE measured_at < %.0f", pastDateInSeconds]];
It's sorta verbose but you get the idea. Ideally I'd spawn a thread
and run this there but for now, it's just running as the last thing
after the app finishes startup.
This crashes, every time, though without any helpful error message.
Just straight up dies and dumps me into non-symbolicated code in the
debugger.
Any ideas? The 'wave' table does indeed exist. Am I just doing this
wrong? This was cribbed out of that presentation that Jeff posted. Any
help appreciated.
Cheers,
Hunter