Chapter 28: I can't set the custom class for the prototype cell

In Page 658, Chapter 28, iOS_Apprentice_v6.0:

  • When i tried to set the custom class for the prototype cell, the dropdown is empty.

  • I tried to type the class name “LocationCell” into it, but failed.

  • To restart my Mac was of no use.

Does anybody meet the same problem?

Have you checked the code in LocationCell.swift to make sure that LocationCell is extending UITableViewCell? If the correct base class is not set, you will not see the class listed in the dropdown. So that would be the first thing to check.

If you are stuck, you can always compare your code against the provided final project source code to see where your project differs from it, as well.

Thank you @fahim! When I creating the LocationCell.swift, I made it a subclass of UITableViewController, instead of UITableViewCell.

Now I know I can always compare my code against the provided source code. Thanks again for your instant reply!

This topic was automatically closed after 166 days. New replies are no longer allowed.