小编Ren*_*enu的帖子

Swift编译器错误 - 为'tableView'发出SIL时

使用Xcode 6 Beta 5.我正在构建一个tableviewcontroller,这几行代码将无法编译.

func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! 
{
    let cell : OrderHistoryCell = tableView.dequeueReusableCellWithIdentifier("CellForOrderHistory", forIndexPath: indexPath) as OrderHistoryCell

    var orderHistoryDataModel: OrderHistoryDataModel = self.orderItemsArray[indexPath.section][indexPath.row - 1] as OrderHistoryDataModel

    cell.nameLabel.text = orderHistoryDataModel.orderItem.title
    cell.statusLabel.text = orderHistoryDataModel.shipment.shippingStatus.toRaw()

    let imageData: NSData = NSData(contentsOfURL: orderHistoryDataModel.orderItem.imageURL)
    cell.thumbnailImageView.image = UIImage(data: imageData)

    return cell
}
Run Code Online (Sandbox Code Playgroud)

这是编译错误:

CompileSwift normal x86_64 com.apple.xcode.tools.swift.compiler
     ........ ............

 Stack dump: ....... ........
 intermediates/newProject.build/Debug-iphonesimulator/newProject.build/Objects-
 normal/x86_64/OrderHistoryViewController.o

 1. While emitting SIL for 'tableView' at /Users/testuser/Downloads/newProject/newProject/OrderHistoryViewController.swift:131:5
 <unknown>:0: error: unable to execute command: Segmentation fault: …
Run Code Online (Sandbox Code Playgroud)

xcode uitableview ios swift

5
推荐指数
1
解决办法
6969
查看次数

标签 统计

ios ×1

swift ×1

uitableview ×1

xcode ×1