Ios xcode 7.0存在序列问题
我是Xcode的新手。 当我点击按钮导航table view应用程序刚挂起并将其导航到AppDelegate页面时, 这是我的密码Ios xcode 7.0存在序列问题,ios,xcode,swift,Ios,Xcode,Swift,我是Xcode的新手。 当我点击按钮导航table view应用程序刚挂起并将其导航到AppDelegate页面时, 这是我的密码 import UIKit class ViewController: UIViewController { let bookPicker = ["Book 1","Book 2","Book 3","Book 4" ] @IBOutlet private weak var tableView: UITableView? override func viewD
import UIKit
class ViewController: UIViewController {
let bookPicker = ["Book 1","Book 2","Book 3","Book 4" ]
@IBOutlet private weak var tableView: UITableView?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell =
tableView.dequeueReusableCellWithIdentifier("customcell") as UITableViewCell!
if (indexPath.item % 2 == 0){
cell.backgroundColor = UIColor.clearColor()
}
else{
cell.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.2)
cell.textLabel!.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.0)
}
cell.textLabel!.textColor = UIColor.whiteColor()
cell.textLabel!.text = bookPicker[indexPath.item]
return cell
}
}
附加故事板图片
当我运行应用程序并点击按钮时,它会带我进入下一页
您的numberOfRowsInSection:方法在哪里?您忘了添加numberOfRowsInSection方法您能解释一下怎么做吗?看一下这个谢谢我做了完全相同但仍然相同的任何其他建议请