CoreData (NSPredicate)



  • We need to filter Baz and show only those cells that were altered less than a minute ago.

    When the cell is updated, I'm changing her parameter.

    mapPoint["lastUpdate"] = NSDate()
    

    Tell me how to do NSPredicate.

    let fetchRequest = NSFetchRequest(entityName: "MapPoint")
    let startInterval = NSDate(timeIntervalSinceNow: -60).timeIntervalSince1970
    

    fetchRequest.predicate = NSPredicate(format:"lastUpdate > %@", startInterval)

    That way doesn't work. ♪ ♪



  • You're comparing. NSDate c NSTimeInterval(i mean.) Double)

    Either keep it. NSTimeIntervalor NSPredicate compare dates.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2