Ios Swift程序在Xcode上崩溃
我正在尝试用iOS模拟器在swift中运行一个简单的表视图应用程序。但一旦模拟器启动,应用程序就会崩溃 这是我的代码:Ios Swift程序在Xcode上崩溃,ios,xcode,swift,Ios,Xcode,Swift,我正在尝试用iOS模拟器在swift中运行一个简单的表视图应用程序。但一旦模拟器启动,应用程序就会崩溃 这是我的代码: import UIKit class ViewController: UIViewController, UITableViewDataSource,UITableViewDelegate { var restaurantNames = ["Cafe Deaden", "Home 1", "Teakha", "cafe Loisal","petite Oyster"
import UIKit
class ViewController: UIViewController, UITableViewDataSource,UITableViewDelegate {
var restaurantNames = ["Cafe Deaden", "Home 1", "Teakha", "cafe Loisal","petite Oyster","For Kee Restaurant","pos Atelier","Bourke Street Bakery", "Haigh's Chocolate"]
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// Return the number of rows in the section.
return restaurantNames.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) ->
UITableViewCell {
let cellIdentifier = "Cell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath:
indexPath) as UITableViewCell
// Configure the cell...
cell.textLabel!.text = restaurantNames[indexPath.row]
return cell
}
}
var restaurantNames中的线程1断点1.5。我不知道从哪里开始故障排除。任何帮助都会很好
谢谢和干杯这不是崩溃,你只是有一个断点 转到调试->停用断点 这里有一些关于断点的苹果文档
如果添加*完整错误消息,则会有所帮助。下一步:readdup在使用Xcode调试器时,您对Xcode和调试器的了解越多,开发代码就越容易。哦,酷!那帮我修好了。非常感谢你!此刻有点觉得自己很愚蠢