Reputation: 11
I am trying to assign text in Custom Tableview Cell in Swift language. But It gives error stating "fatal error: unexpectedly found nil while unwrapping an Optional value"
https://i.sstatic.net/333xS.png
Upvotes: 0
Views: 70
Reputation: 975
You should probably use the line of code in the following UITableView Data Source Method. Your code should look like this:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: BlogTableCell! = tableVIew.dequeueReusableCellWithIdentifier("BlogTableCell") as! BlogTableCell
}
Upvotes: 0
Reputation:
There shouldn't be an error.check for mistyped identifier in the identifier field.
Upvotes: 0