发表文章

[Objective-C] CDEEEventIntegrator mergeEventsWithCompletion: _block_invoke 91 导致应用程序崩溃 CDEEEventIntegrator mergeEventsWithCompletion:_block_invoke.91 Causing App Crash[ensembles]

JDSX 2017-10-9 30

我的项目已经和运行使用的合奏, 但一旦我迁移到 Swift 3 我的应用程序现在崩溃。但是, 当调试时, 这些错误都指向框架。同步时, 我一直在控制台中看到以下错误:

无法加载任何客观 C 类信息。这将显著降低可用类型信息的质量。

或当我离开应用程序运行我得到以下内存问题

来自调试器的消息: 由于内存问题而终止

当我进一步使用仪器挖掘时, 我发现 CPU 超过 100%, 内存和能量的影响都很高。当应用程序崩溃时, 它将我带到 CDEEventIntegrator class、 mergeEventsWithCompletion 函数和 "在后台队列上集成" 的调度行。

我不确定如何解决这个错误, 我甚至打开 iCloud 驱动器的应用程序在设置, 但应用程序仍然崩溃后的某个时候启动。我发现与 iCloud ManagedObjects 会继续重复。

这是我在 appDelegate 的快速3功能。

    // MARK: Ensembles

    var cloudFileSystem: CDECloudFileSystem!
    var ensemble: CDEPersistentStoreEnsemble!

    func syncWithCompletion(completion:@escaping (_ completed:Bool) -> Void) {

        if !ensemble.isLeeched {
            ensemble.leechPersistentStore { error in
                if error != nil {
                    print("cannot leech \(error!.localizedDescription)")
                    completion(false)
                }
                else {
                    print("leached!!")
                    completion(true)
                }
            }
        }
        else {
            ensemble.merge{ error in
                if error != nil {
                    print("cannot merge \(error!.localizedDescription)")
                    completion(false)
                }
                else {
                    print("merged!!")
                    completion(true)
                    //NSNotificationCenter.defaultCenter().postNotificationName("Updated-DB", object: nil)
                }
            }
        }
    }

    func persistentStoreEnsemble(_ ensemble: CDEPersistentStoreEnsemble, didSaveMergeChangesWith notification: Notification) {
        managedObjectContext.performAndWait {
            print("Database was updated from iCloud")
            self.managedObjectContext.mergeChanges(fromContextDidSave: notification as Notification)
            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "Updated-DB"), object: nil)
        }
    }

    private func persistentStoreEnsemble(ensemble: CDEPersistentStoreEnsemble!, globalIdentifiersForManagedObjects objects: [AnyObject]!) -> [AnyObject]! {
        return (objects as NSArray).value(forKeyPath: "uniqueIdentifier") as! [AnyObject]
    }

这就是我在控制台中看到的

screen shot 2016-09-12 at 17 16 51

如前所述, 该项目是在早期版本的雨燕, 但现在我的功能已被迁移到 swift 3 我得到的错误提到。有没有人有任何想法, 为什么会发生这种情况?

PS: 我实际上是运行最后的测试之前提交我的应用程序 iOS 10 和不幸的是, 这个问题已经阻止了。奇怪, 我没有任何问题, 直到今天

原文:

My project was already up and running using Ensembles however once I migrated to Swift 3 my app now crashes. However the errors all point to the framework when debugging. I keep seeing the following error in the console when syncing;

Could not load any Objective-C class information. This will significantly reduce the quality of type information available.

or when I leave the app running I get the following memory issue

Message from debugger: Terminated due to memory issue

And when I dig further using instruments I found that the CPU over 100%, and memory and energy impact both high. When the app crashes It takes me to CDEEventIntegrator class, mergeEventsWithCompletion function and the dispatch line for `"integrate on background queue".

Im unsure how to resolve this error, and I even turned iCloud drive for the app off in settings however the app still crashes sometime after launching. I have found with iCloud ManagedObjects would keep duplicating.

Here's my Swift 3 functions in the appDelegate.

    // MARK: Ensembles

    var cloudFileSystem: CDECloudFileSystem!
    var ensemble: CDEPersistentStoreEnsemble!

    func syncWithCompletion(completion:@escaping (_ completed:Bool) -> Void) {

        if !ensemble.isLeeched {
            ensemble.leechPersistentStore { error in
                if error != nil {
                    print("cannot leech \(error!.localizedDescription)")
                    completion(false)
                }
                else {
                    print("leached!!")
                    completion(true)
                }
            }
        }
        else {
            ensemble.merge{ error in
                if error != nil {
                    print("cannot merge \(error!.localizedDescription)")
                    completion(false)
                }
                else {
                    print("merged!!")
                    completion(true)
                    //NSNotificationCenter.defaultCenter().postNotificationName("Updated-DB", object: nil)
                }
            }
        }
    }

    func persistentStoreEnsemble(_ ensemble: CDEPersistentStoreEnsemble, didSaveMergeChangesWith notification: Notification) {
        managedObjectContext.performAndWait {
            print("Database was updated from iCloud")
            self.managedObjectContext.mergeChanges(fromContextDidSave: notification as Notification)
            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "Updated-DB"), object: nil)
        }
    }

    private func persistentStoreEnsemble(ensemble: CDEPersistentStoreEnsemble!, globalIdentifiersForManagedObjects objects: [AnyObject]!) -> [AnyObject]! {
        return (objects as NSArray).value(forKeyPath: "uniqueIdentifier") as! [AnyObject]
    }

This is what I am seeing in the console

screen shot 2016-09-12 at 17 16 51

As mentioned the project was working in previous versions of Swift, but now that my functions have been migrated to Swift 3 I am getting the errors mentioned. Does anyone have any ideas why this might be happening ?

PS: I was actually running final tests before submitting my app for iOS 10 and unfortunately this issue has prevented that. Weird how I haven't had any issues until today

相关推荐
最新评论 (17)
drewmccormack 2017-10-9
1

我相当肯定我们几个星期前就修好了你有什么版本的代码?

您应该使用您在购买时收到的链接下载最新的代码, 或者--如果您有权访问 github 的回购-更新到最新的主分支。

亲切问候
提请

在 2016年9月12日, 在 19:11, Jas Singh notifications@github.com notifications@github. com写道:

我的项目已经和运行使用的合奏, 但一旦我迁移到 Swift 3 我的应用程序现在崩溃时, 试图同步与以下错误;

无法加载任何客观 C 类信息。这将显著降低可用类型信息的质量。

我不确定如何解决此错误, 下面是我在 appDelegate 中的功能。

// MARK: Ensembles

var cloudFileSystem: CDECloudFileSystem!
var ensemble: CDEPersistentStoreEnsemble!

func syncWithCompletion(completion:@escaping (_ completed:Bool) -> Void) {

    if !ensemble.isLeeched {
        ensemble.leechPersistentStore { error in
            if error != nil {
                print("cannot leech \(error!.localizedDescription)")
                completion(false)
            }
            else {
                print("leached!!")
                completion(true)
            }
        }
    }
    else {
        ensemble.merge{ error in
            if error != nil {
                print("cannot merge \(error!.localizedDescription)")
                completion(false)
            }
            else {
                print("merged!!")
                completion(true)
                //NSNotificationCenter.defaultCenter().postNotificationName("Updated-DB", object: nil)
            }
        }
    }
}

func persistentStoreEnsemble(_ ensemble: CDEPersistentStoreEnsemble, didSaveMergeChangesWith notification: Notification) {
    managedObjectContext.performAndWait {
        print("Database was updated from iCloud")
        self.managedObjectContext.mergeChanges(fromContextDidSave: notification as Notification)
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "Updated-DB"), object: nil)
    }
}

private func persistentStoreEnsemble(ensemble: CDEPersistentStoreEnsemble!, globalIdentifiersForManagedObjects objects: [AnyObject]!) -> [AnyObject]! {
    return (objects as NSArray).value(forKeyPath: "uniqueIdentifier") as! [AnyObject]
}

我看到的错误发生在线程10时, CDEEEventIntegrator mergeEventsWithCompletion: _block_invoke. 91

这就是我在控制台中看到的

http://image.bugshoot.cn/cloud.githubusercontent.com/assets/5117290/18445163/23e7d388-7914-11e6-8e9d-87ed2597fa44.png
如前所述, 该项目是在早期版本的雨燕, 但现在我的功能已被迁移到 swift 3 我得到的错误提到。


您收到此项是因为您已订阅此线程。
直接回复此电子邮件, 请在 GitHub #244上查看该邮件, 或对线程https://github.com/notifications/unsubscribe-auth/AAEuABjRCJef2cMJwKTXXtBdXsgANp9Qks5qpYe1gaJpZM4J60B3进行静音。

原文:

I am fairly sure we fixed this a couple of weeks ago. What version of the code do you have?

You should either download the latest code using the link you received when you purchased, or — if you have access to the github repo — update to the latest master branch.

Kind regards,
Drew

On 12 Sep 2016, at 19:11, Jas Singh notifications@github.com wrote:

My project was already up and running using Ensembles however once I migrated to Swift 3 my app now crashes when trying to sync with the following error;

Could not load any Objective-C class information. This will significantly reduce the quality of type information available.

Im unsure how to resolve this error, here's my functions in the appDelegate.

// MARK: Ensembles

var cloudFileSystem: CDECloudFileSystem!
var ensemble: CDEPersistentStoreEnsemble!

func syncWithCompletion(completion:@escaping (_ completed:Bool) -> Void) {

    if !ensemble.isLeeched {
        ensemble.leechPersistentStore { error in
            if error != nil {
                print("cannot leech \(error!.localizedDescription)")
                completion(false)
            }
            else {
                print("leached!!")
                completion(true)
            }
        }
    }
    else {
        ensemble.merge{ error in
            if error != nil {
                print("cannot merge \(error!.localizedDescription)")
                completion(false)
            }
            else {
                print("merged!!")
                completion(true)
                //NSNotificationCenter.defaultCenter().postNotificationName("Updated-DB", object: nil)
            }
        }
    }
}

func persistentStoreEnsemble(_ ensemble: CDEPersistentStoreEnsemble, didSaveMergeChangesWith notification: Notification) {
    managedObjectContext.performAndWait {
        print("Database was updated from iCloud")
        self.managedObjectContext.mergeChanges(fromContextDidSave: notification as Notification)
        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "Updated-DB"), object: nil)
    }
}

private func persistentStoreEnsemble(ensemble: CDEPersistentStoreEnsemble!, globalIdentifiersForManagedObjects objects: [AnyObject]!) -> [AnyObject]! {
    return (objects as NSArray).value(forKeyPath: "uniqueIdentifier") as! [AnyObject]
}

And I see the error occurs on thread 10 when CDEEEventIntegrator mergeEventsWithCompletion:_block_invoke.91

and this is what I am seeing in the console

http://image.bugshoot.cn/cloud.githubusercontent.com/assets/5117290/18445163/23e7d388-7914-11e6-8e9d-87ed2597fa44.png
As mentioned the project was working in previous versions of Swift, but now that my functions have been migrated to Swift 3 I am getting the errors mentioned.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub #244, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEuABjRCJef2cMJwKTXXtBdXsgANp9Qks5qpYe1gaJpZM4J60B3.

JDSX 2017-10-9
2

不幸的是, 我使用最新版本。我甚至更新了今天, 删除了项目应用程序从两个设备, 清除 iCloud 数据, 并开始新鲜, 看看会发生什么。首先, 两个设备都不会与错误同步, cannot merge The operation couldn’t be completed. (CDEErrorDomain error 101.) 然后发生的运行时崩溃的错误warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.

以前, 当我已经能够获取 iCloud 数据后, 从设备中删除的应用程序的数据将得到复制。对于每一次的数据将 x2, 我实际上 eded 了26x 数据与300mb 占用了一个点后, 从设备上删除了几个小时后, 然后重新。

希望更新应用程序商店 iOS 10 的应用程序, 但无法与当前的同步 ing bug。我很想去 CloudKit 合奏的框架, 但不确定如何快速, 我将能够设置为 iCloud 似乎是创造了很多麻烦。也

原文:

Unfortunately I am using the latest release. I even updated today, removed the project app from both devices, cleared iCloud data and started fresh to see what would happen. At first neither device would sync with the error cannot merge The operation couldn’t be completed. (CDEErrorDomain error 101.) then the got runtime crashes with the error warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.

Previously when I have been able to fetch iCloud data after removing the app from the device the data would get duplicated. For each time the data would x2, I actually eded up with 26x data with 300mb taken up at one point after removing the app from the device for a few hours then re-installing.

Was hoping to update an app on the App Store for iOS 10 however am unable to with the current sync ing bugs. Am tempted to go for the CloudKit ensembles framework but unsure how quick I would be able to set up as iCloud seems to be creating to much hassle. Also

drewmccormack 2017-10-9
3

我刚刚更新了简单的同步示例到 Swift 3, 它似乎是正常工作。

也许这是值得尝试运行你的项目与僵尸启用, 看看这是否给我们一个线索。

原文:

I just updated the Simple Sync example to Swift 3, and it seems to be working OK.

Maybe it is worth trying to run your project with the Zombies enabled, to see if that gives us a clue.

drewmccormack 2017-10-9
4

啊, 我刚意识到你在使用开源合奏。是吗?那里可能还有问题。我只更新了合奏2。

我将查看是否可以将有关更改恢复到开源项目。设置僵尸仍然有助于证实这一点。

原文:

Ah, I just realised you are using the open source Ensembles. Is that right? There may well still be a problem there. I have only been updating Ensembles 2.

I will see if I can bring back the relevant changes to the open source project. Setting Zombies would still help to confirm this.

JDSX 2017-10-9
5

是的, 没错, 这是有道理的。我想熟悉开源框架, 但我刚刚购买了合奏 2, 因为1已经为我服务好几个月, 并与 Swift 3 支持和 CloudKit 的升级是有意义的。将尝试更新我的项目, 希望一切将再次运行顺利

原文:

Yes I am, oh right that makes sense. I wanted to get familiar with the open source framework, however I have just purchased Ensembles 2 because 1 has served me well for a few months, and with Swift 3 support and CloudKit the upgrade makes sense. Will try to update my project and hopefully everything will run smooth again

JDSX 2017-10-9
6

如何才能访问 Swift 3 中的简单同步项目?由于下载文件仍然在 swift 2。2

原文:

How can I get access to the Simple Sync project in Swift 3 ? As the download files are still in swift 2.2

drewmccormack 2017-10-9
7

它目前只在 github 回购主分支。如果你给我你的 github 用户名, 我会给你访问。

提请

在 2016年9月13日, 在 15:37, Jas Singh notifications@github.com notifications@github. com写道:

如何才能访问 Swift 3 中的简单同步项目?


你收到这个是因为你的评论。
直接回复此电子邮件, 请在 GitHub #244 (注释)上查看它, 或对线程https://github.com/notifications/unsubscribe-auth/AAEuAGo9OOC5A2HNBEm3myWEH0igbeN-ks5qpqcKgaJpZM4J60B3进行静音。

原文:

It’s currently only in the github repo master branch. If you send me your github username, I will give you access.

Drew

On 13 Sep 2016, at 15:37, Jas Singh notifications@github.com wrote:

How can I get access to the Simple Sync project in Swift 3 ?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #244 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAEuAGo9OOC5A2HNBEm3myWEH0igbeN-ks5qpqcKgaJpZM4J60B3.

JDSX 2017-10-9
8

我只是发送了一封电子邮件, 但我的用户名是 JDSX, 你有任何 CloudKit 的例子在 Swift 尚未?

原文:

I just actually sent over an email but my username is JDSX, do you have any CloudKit examples in Swift yet ?

drewmccormack 2017-10-9
9

只是增加了你的回购。

不, 我们只在 Swift 中有简单的同步示例。惯用的例子 (ObjC) 包括 CloudKit。应该只是在 Swift 的小差异。

原文:

Just added you to repo.

No, we only have the Simple Sync example in Swift. The Idiomatic example (ObjC) does include CloudKit. Should only be small differences in Swift.

smallhorse1987 2017-10-9
10

我还有 v1.6 的问题
Xcode8+iCloud

原文:

I still have this problem with v1.6.
Xcode8+iCloud

drewmccormack 2017-10-9
11

你能打开你的应用程序僵尸, 告诉我它在哪里崩溃?这个信息目前有点模糊。

原文:

Can you turn on Zombies in your app and tell me where it is crashing? This info is a bit vague at the moment.

smallhorse1987 2017-10-9
12

好吧, 我明天会收集更多的信息。

到目前为止, 我回滚到 Xcode7, 然后问题消失了。

原文:

Well, I will collect more information tomorrow.

So far, I rollback to Xcode7, then the issue is gone.

smallhorse1987 2017-10-9
13

预置条件:
1, 由 Xcode8 编译。
2、刷新安装
3、第一次从 iCloud 获取 & 基数据。

调试资讯:
default

** 僵尸调试信息:
-[NSError 保留]: 发送到释放实例0x174c420a0 的消息

原文:

Pre-condition:
1,compiled by Xcode8.
2, refresh installation
3, first time to fetch& rebase data from iCloud.

Debug Infomation:
default

**Zombie debug info:
-[NSError retain]: message sent to deallocated instance 0x174c420a0

drewmccormack 2017-10-9
14

这是发布版本 (1.6) 吗?如果可能的话, 你能把最新的树干从 GitHub 吗?我做了很多改进 NSError 处理, 我想我抓住了。

原文:

Is that the release version (1.6)? If possible, can you pull the latest trunk from GitHub? I made a bunch more improvements to NSError handling, and I think I caught that one.

drewmccormack 2017-10-9
15

刚刚检查过了是的, 我改变了密码请参见此提交的结尾: bedc3f8 bedc3f8

提请

在 2016年10月14日, 04:12, smallhorse1987 notifications@github.com notifications@github. com写道:

预置条件:
1, 由 Xcode8 编译。
2、刷新安装
3、在切换到后台后快速将 app 转到前台。

调试资讯:
http://image.bugshoot.cn/cloud.githubusercontent.com/assets/18483946/19373422/5f8a79ae-91f6-11e6-8a32-92e5bb21c554.png
** 僵尸调试信息:
-[NSError 保留]: 发送到释放实例0x174c420a0 的消息


您收到此项是因为您修改了 "打开/关闭" 状态。
直接回复此电子邮件, 请在 GitHub #244 (注释)上查看它, 或对线程https://github.com/notifications/unsubscribe-auth/AAEuADsrujLpZbKlsmyPHOMc2PA-UzKJks5qzuUEgaJpZM4J60B3进行静音。

原文:

Just checked. Yes, I did change that code. See very end of this commit: bedc3f8 bedc3f8

Drew

On 14 Oct 2016, at 04:12, smallhorse1987 notifications@github.com wrote:

Pre-condition:
1,compiled by Xcode8.
2, refresh installation
3, turn app to foreground quickly right after it switch to background.

Debug Infomation:
http://image.bugshoot.cn/cloud.githubusercontent.com/assets/18483946/19373422/5f8a79ae-91f6-11e6-8a32-92e5bb21c554.png
**Zombie debug info:
-[NSError retain]: message sent to deallocated instance 0x174c420a0


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub #244 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AAEuADsrujLpZbKlsmyPHOMc2PA-UzKJks5qzuUEgaJpZM4J60B3.

mastro35 2017-10-9
16

是的, 1.6.1 解决了问题。不幸的是, CocoaPods 提供的版本仍然是 1.6, 所以一定要得到最新的版本从这里使用在您的 PodFile

pod 'Ensembles', :git => 'https://github.com/drewmccormack/ensembles.git'

原文:

yep, 1.6.1 solve the problem. Unfortunately the version provided by CocoaPods is still the 1.6 so be sure to get the latest version from here by using in your PodFile

pod 'Ensembles', :git => 'https://github.com/drewmccormack/ensembles.git'

drewmccormack 2017-10-9
17

对不起, 一定是忘了推更新了。好了

原文:

Sorry, somehow must have forgotten to push the update. Now done.

返回
发表文章
JDSX
文章数
1
评论数
4
注册排名
60662