这段代码会产生保留周期吗? (核心数据执行)

时间:2019-01-29 06:02:23

标签: core-data closures retain-cycle retaincount

extension NSManagedObject{
    /// Perform on main context asynchrounously
        /// SaveContext will be called after the block() is executed
        /// - Parameter block: The blcok of code passing context as param
        class func performOnMainContext(_ block:@escaping ClosureTypes.managedObjectContextClosure){
            let context:NSManagedObjectContext! = appDataController().mainContext()
            context.perform {
                block(context)
                context.saveContext()
            }
        }
}

1 个答案:

答案 0 :(得分:0)

没有保留周期,但是这段代码没有意义。