title: How to convert predicates to SQL statement?
body: <p>I am encountering a problem in my iOS app happening after 3 days of gathering data from server. I'm trying to pinpoint the problem and don't know if its a data corruption problem or a problem in the code.</p>
  
  <p>I have downloaded the iOS database to my Mac and can run sql statements against it.</p>
  
  <p>Is there a way to "convert" the following predicates to SQL statement so that I can verify the data?</p>
  
  <pre><code>    NSMutableArray *predicates = [[NSMutableArray alloc] init];
      NSDate *twoWeeksago = [[NSCalendar autoupdatingCurrentCalendar] dateByAddingUnit:NSCalendarUnitDay
                                                                             value:-14
                                                                            toDate:[NSDate date]
                                                                           options:0];
      [predicates addObject:[NSPredicate predicateWithFormat:@"isRemoved == 0"]];
      [predicates addObject:[NSPredicate predicateWithFormat:@"(publicationDatetime &gt;= %@) AND (publicationDatetime &lt;= %@)", twoWeeksago, [NSDate date]]];
      [predicates addObject:[NSPredicate predicateWithFormat:@"(source == %@) OR (source == %@)", @"BBC", @"Guardian"]];
      NSPredicate *predicate = [NSCompoundPredicate andPredicateWithSubpredicates:predicates];
  </code></pre>