I created a UITableView
(and related classes), with two sections:
To control the static cell, I implement a class, and in that class I added IBOutlet
to an object (for example label) in the static cell. When I attempt to access that outlet in the class controlling the table view, I get this error:
outlet doesn't exist
I made a video, for explain better my problem.
Short version
UITableView
cannot be at the same time a Static Cells and a Dynamic Prototypes content. You need to pick one or the other.
Because you need Dynamic Prototypes, use Dynamic Prototypes.
Long version
Steps to create Dynamic Prototypes:
UITableViewCell
, and apply that custom class to the relevant cell or cells (IB > Show the Identity Inspector), and pick your Custom Class from the list. This of course implies you have created such sub-classes.dequeueReusableCellUsingIdentifier;
With this setup, you can select your Table View Cell, IB > Show Assistant Editor, and control-drag references in your custom class. You may need to tell the Assistant Editor which file to pick.
(†) There are plenty of other ways to do this ; all outside of the scope of this response.