如何使用Magical Record从特定上下文中删除一组实体?

时间:2015-04-07 10:25:39

标签: swift core-data magicalrecord

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:方法不起作用

1 个答案:

答案 0 :(得分:0)

具体context

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