2013-06-02 2 views
5

Xcode에서 싫어하는 UITableViewCell의 두 가지 사용자 정의 하위 클래스가 있습니다.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]; 

그리고 나는 오류 받고 있어요 :과 같이 방법 : forReuseIdentifier : 나는있는 registerClass를 호출하기 위해 노력하고있어 "대신에 예기치 않은 인터페이스 이름 ... 예상 식을." 오류. 어떤 아이디어?

답변

8

당신은 ClassregisterClass:forCellReuseIdentifier:에 보낼 필요는 그래서 당신은이 작업을 수행 할 필요가 :

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

행운을 빕니다!

1

신경 쓰지 마라. 알아 냈어. 이제 막 [ButtonCell 클래스]를 수행해야했습니다.

+0

그게 전부 야! 내 대답을 게시 할 때까지 이걸 보지 못했습니다 ... – Daniel

관련 문제