[英]ios app crashes on fill cell with image literal only on ios 9 not clear crash log
我有一個電子商務應用程序,可以查看用戶的產品列表,而在最新更新之后,我僅從ios 9上的Fabric crashlytics接收到很多崩潰,而我在測試時無法以任何方式進行復制。
相關的崩潰日志
0 libswiftUIKit.dylib 0x10166f218 _TToFE5UIKitCSo7UIImagecfT24imageLiteralResourceNameSS_S0_ + 224
1個libswiftUIKit.dylib 0x10166f040 _TFE5UIKitCSo7UIImageCfT24imageLiteralResourceNameSS_S0_ + 96
2個“ AppName” 0x1000e7788專門的ItemsSubCategoriesCell.fill(withInfo:ItemsSubCategory)->()(ItemsSubCategoriesCell.swift:39)
3“ AppName” 0x1000b9b88專門的ItemsSubCategoriesViewController.tableView(UITableView,cellForRowAt:IndexPath)-> UITableViewCell(ItemsSubCategoriesViewController.swift)
4“ AppName” 0x1000b91c4 @objc ItemsSubCategoriesViewController.tableView(UITableView,cellForRowAt:IndexPath)-> UITableViewCell(ItemsSubCategoriesViewController.swift)
相關代碼塊
func fill(withInfo info: ItemsSubCategory) {
backgroundColor = info.primaryColor
numberOfItemsLabel.text = "\(info.items.count)"
discloseIndicatorImageView.image = #imageLiteral(resourceName: "Disclosure Indicator").withRenderingMode(.alwaysTemplate)
discloseIndicatorImageView.tintColor = info.darkBackground ? UIColor.white : UIColor.gray
if let imageURLString = info.photoFile?.url {
sectionImageView.sd_setImage(with: URL(string: imageURLString)!)
}
}
問題是,我試圖在多個測試手機上復制此崩潰,並且希望獲得任何指向崩潰可能原因的指針
編輯:我嘗試更改圖像名稱以刪除空格,並且還嘗試使用資源名稱而不是使用#imageliteral來圖像,並嘗試在本地和testflight上對其進行測試,而沒有崩潰,並投入生產,崩潰又回來了。
這解決了我的問題
backgroundColor = info.primaryColor
numberOfItemsLabel.text = "\(info.items.count)"
let tempImage = UIImage(named: "DisclosureIndicator")
discloseIndicatorImageView.image = tempImage?.withRenderingMode(.alwaysTemplate)
discloseIndicatorImageView.tintColor = info.darkBackground ? UIColor.white : UIColor.gray
我剛剛創建了一個tempImage UIIMage,然后為其分配了
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.