我正在尝试调试以下崩溃,并且对这个错误的含义有些不清楚。我从使用iPhone应用程序的用户那里得到了这个错误,并且该崩溃是通过Crashlytics传递过来的。
崩溃标题为:EXC_BREAKPOINT 0x00000000e7ffdefe 崩溃位置为: com.apple.main-thread
线程: Crashed: com.apple.main-thread 0 Mutual 0xfff58 AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift:78) 1 Mutual 0xfe95c partial apply for AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift) 2 Mutual 0xfe95c partial apply for AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift) 3 FBSDKCoreKit 0x5a2661 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 96
它指向的代码(AlbumViewController的第78行)是此函数的结束括号。
崩溃标题为:EXC_BREAKPOINT 0x00000000e7ffdefe 崩溃位置为: com.apple.main-thread
线程: Crashed: com.apple.main-thread 0 Mutual 0xfff58 AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift:78) 1 Mutual 0xfe95c partial apply for AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift) 2 Mutual 0xfe95c partial apply for AlbumViewController.(getFacebookAlbums(() -> ()) -> ()).(closure #1) (AlbumViewController.swift) 3 FBSDKCoreKit 0x5a2661 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 96
它指向的代码(AlbumViewController的第78行)是此函数的结束括号。
func getFacebookAlbums(completion: (() -> Void)? = nil){
FBSDKGraphRequest(graphPath: "me/albums?fields=name,picture,count&limit=16&offset=\(offset)", parameters: nil).startWithCompletionHandler { (connection: FBSDKGraphRequestConnection!, result: AnyObject!, error: NSError!) -> Void in
if let albumData = result["data"] as? NSArray{
for album in albumData{
let albumName = album["name"] as? String ?? ""
let albumId = album["id"] as? String ?? "-1"
let count = album["count"] as? Int ?? 0
var coverURL = ""
if let picture = album["picture"] as? NSDictionary{
if let pictureData = picture["data"] as? NSDictionary{
coverURL = pictureData["url"] as? String ?? ""
}
}
let newAlbum = AlbumData(name: albumName, id: albumId, coverURL: coverURL, photosCount: count)
self.albums.append(newAlbum)
}
self.albumView.tableView.reloadData()
self.albumView.tableView.hidden = false
self.albumView.loadingView.hideLoadingView()
completion?()
self.downloadAlbumThumbnails()
}
}
}
这个错误信息过于模糊,非常难以调试。有没有人了解是什么原因导致的?
更新:
这里是从Crashlytics中获取到的屏幕截图:
这是方法调用和闭包内容:
getFacebookAlbums { () -> Void in
self.albumView.activityIndicator.stopAnimating()
self.albumView.refreshContorl.endRefreshing()
}