0

Created a new project on XCode 8, installed 1 pod that is of Alamofire and then checked my app if everything is ok, it ran well. And then I hooked up a tableView in the interface builder as I would previously do in earlier versions of XCode, defined the classes, connected the tableviewCell and when I run, the app crashed on my iPhone 5s, being used as my test device. Moreover, there is no error line that I could encounter or shown to the console. Also, I have not force unwrapped any optional. The code crashes before it could reach viewDidLoad() method in the starting viewController.

amagain
  • 2,042
  • 2
  • 20
  • 36

1 Answers1

0

Set identifier in the Storyboard/xib of the Custom Cell like below:

enter image description here

Use same identifier in tableView delegate method cellForRowAtIndexPath:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{

        let cell = tableView.dequeueReusableCellWithIdentifier("TableViewCell") as TableViewCell

        //related code here
}
Ronak Chaniyara
  • 5,335
  • 3
  • 24
  • 51
  • Thats right but you cant access your cells properties like Label, Try to access label of your cell in tableview delegate method. I have posted same question – Jitendra Modi Oct 20 '16 at 08:54