【问题标题】:How to simply remove a group of entities from specific context with Magical Record?如何使用 Magical Record 从特定上下文中简单地删除一组实体?
【发布时间】:2015-04-07 10:25:39
【问题描述】:
let predicate = NSPredicate(format: "users.@count == 0")

if let locations = PBOLocation.MR_findAllWithPredicate(predicate, inContext: context) as? [PBOLocation] {
    for location in locations {
        //what now?                        
    }
}

我需要从特定上下文中删除每个已建立的位置。

MR_deleteEntityMR_deleteEntityInContext: 方法不起作用

【问题讨论】:

    标签: swift core-data magicalrecord


    【解决方案1】:

    具体context

    for location in locations {
        context.deleteObject(location)
    }
    

    【讨论】:

      猜你喜欢
      • 2013-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多