난 샘플 코드 ListAdder을 읽고 많은 존재하고, 예를 들면 오른쪽으로 가변 후 주장, 또는 거의 모든 방법에 사용될 :왜 프로젝트에서 '단언'을 사용합니까? (그리고 그렇게 많은 시간을 사용하는 이유)
self.formatter = [[[NSNumberFormatter alloc] init] autorelease]; assert(self.formatter != nil);
또는 :
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
#pragma unused(tv)
#pragma unused(indexPath)
UITableViewCell * cell;
assert(tv == self.tableView);
assert(indexPath != NULL);
assert(indexPath.section < kListAdderSectionIndexCount);
assert(indexPath.row < ((indexPath.section == kListAdderSectionIndexNumbers) ? [self.numbers count] : 1));
궁금한 점은 무엇입니까?
감사
Objective C에 대해 모르지만 다른 언어로되어 있습니다. 컴파일 된 시간에 비활성화되어 라이브 시스템의 속도를 늦추지는 않지만 테스트 및 준비 중에는 버그 감지에 사용할 수 있습니다. – corsiKa