OC

Knowledge OS
登录 注册
全部话题 移民 创业 iOS Mac Objective-C Swift Android 招聘 求职

unexpected found nil 求解啊

kuqiqi
kuqiqi 发布于 2015年01月13日 | 更新于 2015年01月13日
无人欣赏。

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {

 var name11 = ld.name1
 var name22 = ld.name2
 var name33 = ld.name3
 var name44 = ld.name4
 var name55 = ld.name5
 if indexPath.row == 0 {
 gdvc.detailText.text = name11
 }
 if indexPath.row == 1 {
 gdvc.detailText.text = name22
 }
 if indexPath.row == 2 {
 gdvc.detailText.text = name33
 }
 if indexPath.row == 3 {
 gdvc.detailText.text = name44
 }
 if indexPath.row == 4 {
 gdvc.detailText.text = name55
 }
}

name11 到name55 每一行赋值都是unexpected found nil while unwrapping an optional value

共1条回复
楼长 ·
amosji 回复于 2015年01月13日

ld是啥?

登录 或者 注册

AltStyle によって変換されたページ (->オリジナル) /