私はサンプルコード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));
私は疑問に思っていました、それをするためのポイントは何ですか?
ありがとう