Thar Htet
Thar Htet

Reputation: 11

UITableView Custom Cell iPhone Using Swift language

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

Answers (2)

Rehaan Advani
Rehaan Advani

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

user4007645
user4007645

Reputation:

There shouldn't be an error.check for mistyped identifier in the identifier field.

Upvotes: 0

Related Questions