【问题标题】:Will this code produce retain cycle ? (Core Data perform)此代码会产生保留周期吗? (核心数据执行)
【发布时间】:2019-06-22 04:58:56
【问题描述】:
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()
            }
        }
}

【问题讨论】:

    标签: core-data closures retain-cycle retaincount


    【解决方案1】:

    没有保留循环,但这段代码没有意义。

    【讨论】:

    • 感谢您的确认!
    猜你喜欢
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 2013-04-06
    • 1970-01-01
    • 2011-04-28
    • 1970-01-01
    • 2013-11-06
    • 1970-01-01
    相关资源
    最近更新 更多