I am trying to use a custom UITableViewCell.
Setup: Xcode 7.1, Swift, running in Emulator
Steps:
1. Created a new "Cocoa Touch Class"(CMD+N) with Subclass of UITableViewCell
2. Also create XIB file, when creating the swift file.
3. Now I would like to load the XIB file into a TableViewController
override func viewDidLoad() { super.viewDidLoad() let yourNibName = UINib(nibName: "MyTableViewCell", bundle: nil) tableView.registerNib(yourNibName, forCellReuseIdentifier: "test") // << EXC_BAD_INSTRUCTION ... I get: Thread 1: EXC_BAD_INSTRUCTION(code=EXC_I386_INVOP, subcode=0x0)
Info:
1. I can see in the debug area: that yourNibName has a memory address but all other properties is 0x0. Therefore the XIB must not be loaded?
2. I can see it is a member in the Inspector: Target Membership
3. It is in "Build Phases/Copy Bundle Resources"
4. I do Product Clean every each thing I am trying.
But why?