2013-06-02 18 views
5

私はXcodeが好まないUITableViewCellのカスタムサブクラスを2つ持っています。 forReuseIdentifier:そうのような方法:私はregisterClass呼び出ししようとしている「代わりに、予期しないインターフェイス名...期待される表現」UITableViewCellのカスタムサブクラスを登録できません

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]; 

そして、私はエラーを取得していますがエラー。何か案は?

答えて

8

あなたはClassregisterClass:forCellReuseIdentifier:を送信する必要があるので、あなたはこれを実行する必要があります。

[self.tableView registerClass:[ButtonCell class] forCellReuseIdentifier:buttonCellIdentifier]; 
[self.tableView registerClass:[GameCell class] forCellReuseIdentifier:gameCellIdentifier]; 

幸運を!

1

気にしないで、私はそれを理解しました。私は代わりに[ButtonCellクラス]を行う必要がありました。

+0

これだけです!私は私の答えを投稿するまでこれを見ていない... – Daniel

関連する問題