Cannot use a predicate that compares dates in Magical Record

前端 未结 2 1424
小鲜肉
小鲜肉 2020-12-12 02:53

I am making a method that will remove all of my NSManagedObjects that were not updated in the last sync.

- (void)removeStaleObjects {

        // Delete obje         


        
2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 03:12

    The problem is the name "updated" of your attribute. It conflicts with the isUpdated method of NSManagedObject. (See Core Data NSPredicate "deleted == NO" does not work as expected for a similar issue with a "deleted" attribute.)

    If you rename your attribute, everything works as expected.

提交回复
热议问题