У меня есть пользовательская ячейка табличного представления, которую я создал с помощью XIB:
![enter image description here](https://i.stack.imgur.com/uEFH6.png)
Я также связал файл XIB с моей пользовательской ячейкой UITableView.
Но теперь, когда я попытаюсь загрузить ячейку в - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
со следующими кодами:
MyCustomTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
if (cell == nil) {
// Load the top-level objects from the custom cell XIB.
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomTableViewCell" owner:cell options:nil];
// Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
cell = [topLevelObjects objectAtIndex:1];
}
я получу [<NSObject 0x8a5b970> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key hitMeButton.
Я искал в Интернете иодной из возможных причин может быть то, что XIB не связан с IBOutlet, я проверил, так что это не так.