Commit c68704b0b4af8142085435dd42b6eaacc316ebfd
1 parent
a7db224a
解决闪退问题
Showing
3 changed files
with
7 additions
and
7 deletions
metaCode/Classes/Config/Database/CNLiveIdentityDB.swift
| ... | ... | @@ -12,8 +12,7 @@ import WCDBSwift |
| 12 | 12 | let CNLiveIdentityTableName = "CNLiveIdentityTable" |
| 13 | 13 | |
| 14 | 14 | ///身份model |
| 15 | - | |
| 16 | -class CNLiveIdentityModel: BaseModel,TableCodable { | |
| 15 | +final class CNLiveIdentityModel: BaseModel,TableCodable { | |
| 17 | 16 | var id: String = ""//ID号 |
| 18 | 17 | var name: String? = ""//名称 |
| 19 | 18 | var icon: String? = ""//小圆图标 | ... | ... |
metaCode/Classes/Main/HomePage/View/CNHomePageBackgroupView.swift
| ... | ... | @@ -105,6 +105,7 @@ class CNHomePageBackgroupView: UIView{ |
| 105 | 105 | let idModel:CNLiveIdentityModel = idArray[i] |
| 106 | 106 | let navTitle:String = idModel.name! |
| 107 | 107 | subView.setTitle(title: navTitle) |
| 108 | + | |
| 108 | 109 | subView.imageView.kf.setImage(with: URL(string: idModel.backgroundImg!)) |
| 109 | 110 | //.setImageWith(URL(string: idModel.backgroundImg ?? "")!, placeholderImage: UIImage(named: "homePage_backgroup_red")) |
| 110 | 111 | // if (i == 0) { | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/CNHomePageViewModel.swift
| ... | ... | @@ -18,11 +18,11 @@ class CNLiveHomePageViewModel:NSObject { |
| 18 | 18 | |
| 19 | 19 | //先从本地获取,本地有直接返回 |
| 20 | 20 | let db = CNLiveIdentityDB() |
| 21 | - let allDbArray = db.searchAllObject() | |
| 22 | - if(allDbArray.count > 0){ | |
| 23 | - resultBlock(allDbArray,.success,"") | |
| 24 | - return | |
| 25 | - } | |
| 21 | +// let allDbArray = db.searchAllObject() | |
| 22 | +// if(allDbArray.count > 0){ | |
| 23 | +// resultBlock(allDbArray,.success,"") | |
| 24 | +// return | |
| 25 | +// } | |
| 26 | 26 | |
| 27 | 27 | //从网络获取 |
| 28 | 28 | CNLiveNetworking.setAllowRequestDefaultArgument(false) | ... | ... |