I have two custom subclasses of UITableViewCell that Xcode doesn't like. I'm trying to call the registerClass:forReuseIdentifier: method like so:
static NSString* gameCellIdentifier = @"GameCell";
static NSString* buttonCellIdentifier = @"ButtonCell";
// Register the classes for use.
[self.tableView registerClass:ButtonCell forCellReuseIdentifier:buttonCellIdentifier];
[self.tableView registerClass:GameCell forCellReuseIdentifier:gameCellIdentifier];
And I'm getting the error, "Unexpected interface name ... expected expression instead." error. Any ideas?
You need to send a Class
to registerClass:forCellReuseIdentifier:
so you need to do this:
[self.tableView registerClass:[ButtonCell class] forCellReuseIdentifier:buttonCellIdentifier];
[self.tableView registerClass:[GameCell class] forCellReuseIdentifier:gameCellIdentifier];
Good luck !
Never mind, I figured it out. I just needed to do [ButtonCell class] instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With