I have added an image view in one of the image view.I could have use Attributes inspector and then change the image property but i want to do it programmatically.
So far this is what i have done and get the following error
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier account_cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell:UITableViewCell! = UITableViewCell()
if indexPath.section == 0{
if indexPath.row == 0{
cell = tableView.dequeueReusableCellWithIdentifier("account_cell", forIndexPath: indexPath)
if let AccountImage = cell.viewWithTag(100) as? UIImageView{
AccountImage.image = UIImage(named: "Friend_g")?.imageWithRenderingMode(.AlwaysOriginal)
}
}
}
print("\(indexPath)")
return cell
}
Can someone give me a beginners guide how can i achieve it programmatically.Any help would be appreciated.Thanks in advance.