首页 > 解决方案 > 从异常断点创建的断点是什么意思?

问题描述

我在尝试获取核心数据时得到了一个线程 1:信号 SIGABRT,所以我创建了一个异常断点。当我运行程序时,它立即崩溃并添加了两个断点:

objc_exception_throw in libobjc.A.dylib

和:

__cxa_throw in libc++abi.dylib

这些是什么意思?我该如何解决这些问题?

仅供参考:我是 Swift 的新手。

这是我解释代码的最佳方式:

有一个文件,CoreDataHandler,有 5 个函数:

private class func getContext() -> NSManagedObjectContext {
    ...
}

class func savePhotoObject(locationCoordinateLatitude: Double, locationCoordinateLongitude: Double, locationLocality: String, dateCreated: Date, discription: String, photo: Data) -> Bool {
    ...
}

class func fetchPhotoObject() -> [CreatedPhotoPost]? {
    ...
}

class func saveTextObject(locationCoordinateLatitude: Double, locationCoordinateLongitude: Double, locationLocality: String, dateCreated: Date, backgroundColorRed: Int, backgroundColorGreen: Int, backgroundColorBlue: Int, text: String) -> Bool {
    ...
}

class func fetchTextObject() -> [CreatedTextPost]? {
    ...
}

然后在另一个文件中,当按下继续按钮时会发生这种情况:

CoreDataHandler.savePhotoObject(locationCoordinateLatitude: lat, locationCoordinateLongitude: lng, locationLocality: cityState, dateCreated: date, discription: discriptionBox.text!, photo: selectedImageData!)

然后继续按钮也会打开一个文件,这会发生:

post = CoreDataHandler.fetchPhotoObject()

for i in post! {
    ...
}

使用 saveTextObject() 和 fetchTextObject() 重复相同的过程。

希望这可以帮助。

标签: swiftxcodebreakpoints

解决方案


推荐阅读