2010-06-13 3 views
0

표보기에서 셀 값을 가져 오려고하지만이를 허용하지 않습니다. 누군가 도움이된다면 위대한 사람이 될 수 있습니다.코코아 터치에서 표보기 셀 값을 가져올 수 없습니다.

int numberOfChecks = -1; 
numberOfChecks = numberOfChecks +1; 

    if ([objectsForTable count]-1 >= numberOfChecks) { 


     UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:numberOfChecks]; 

     NSString *cellTitle = cell.textLabel.text; 

    } 

답변

0

cellForRowAtIndexPath : 방법은 그 방법은 UITableViewDataSource delegate 의해 제공되고, jQuery과 의해 제공되지 않는다. 데이터를 제공해야하기 때문에 테이블의 dataSource 속성을 위임자를 가리 키도록 설정해야합니다. 이를 가정하면 테이블의 dataSource 속성을 사용하여 데이터 소스를 호출 할 수 있습니다.

NSIndexPath *path = [NSIndexPath indexPathWithIndex: ... ]; 
UITableViewCell *cell = [self.tableView.dataSource tableView:self.tableView 
             cellForRowAtIndexPath:path]; 
관련 문제