Ios 未显示披露指标
我创建了一个UITableView,使用了标准的UITableViewCell,并添加了一个accessoryType,但无论我做什么,它似乎都不会出现。怎么会这样?这是我的密码:Ios 未显示披露指标,ios,iphone,uitableview,swift,Ios,Iphone,Uitableview,Swift,我创建了一个UITableView,使用了标准的UITableViewCell,并添加了一个accessoryType,但无论我做什么,它似乎都不会出现。怎么会这样?这是我的密码: func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! { switch indexPath.row { case 0
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
switch indexPath.row
{
case 0:
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
cell.textLabel?.text = "Kontakt os"
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
return cell
case 1:
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
cell.textLabel?.text = "Privatpolitik"
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
return cell
case 2:
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
cell.textLabel?.text = "Vilkår"
cell.accessoryType = UITableViewCellAccessoryType.DisclosureIndicator
return cell
default:
println()
}
return nil
}
您可以很容易地通过单步查看代码来了解为什么
textlab
s的文本显示正确?是的,我添加了一个image@gamerChristian请问为什么在cellforrowatinexpath
方法中使用switch case,并在其case中实例化单元格?这是很多重复的代码。此外,我也很困惑,你如何能够在不删除所有可选的展开的情况下使用该方法代码>符号,因为通常情况下,如果您不这样做,Xcode 6会给出一个错误。我只是这么做了,我正在这么做,因为这只是一个原型,还会有更多的代码,但现在我正试图展示披露指标