Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios xcode 7.0存在序列问题_Ios_Xcode_Swift - Fatal编程技术网

Ios xcode 7.0存在序列问题

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

我是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 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方法您能解释一下怎么做吗?看一下这个谢谢我做了完全相同但仍然相同的任何其他建议请