使用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)