2015-01-19 3 views
0

배열을 Parse에 저장 했으므로 배열의 개체를 계산 한 다음 그 번호를 레이블에 표시하고 싶습니다. 개체 수를 계산할 수 있지만 어떤 이유로 문자열로 변환하는 방법을 알 수 없습니다. 여기 내 코드는 다음과 같습니다.문자열의 배열에있는 개체를 카운트하십시오.

cell.CheckinLabel.text = (@"count = %d", [[imageObject objectForKey:@"Checkin"] count]); 
    NSLog(@"count = %d", [[imageObject objectForKey:@"Checkin"] count]); 

아무 도움이됩니다.

+0

http://stackoverflow.com/questions/1372715/how-can-i-convert-an-int-to-an-을 nsstring –

답변

1

이 시도 :

NSString *string = [NSString stringWithFormat:@"%d", [[imageObject objectForKey:@"Checkin"] count]]; 
yourlabel.text = string; 

또는

yourlabel.text = [NSString stringWithFormat:@"%d", [[imageObject objectForKey:@"Checkin"] count]]; 
관련 문제