テーブルセルをカスタマイズしています。私は私が間違っているのは何[indexPath row]
[indexPath行]のEXC_BAD_ACCESS
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"WCFPictureCell";
static NSString *CellNib = @"WCFPictureCell";
WCFPictureCell *cell = (WCFPictureCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (WCFPictureCell *)[nib objectAtIndex:0];
}
NSLog(@"iph %@", indexPath);
NSLog(@"iphrow %@", [indexPath row]);
return cell;
}
にアクセスしようとしたときに私にEXC_BAD_ACCESS
を与えている、このコード(簡易)を持っていますか?
おかげ
なぜあなたは%iを使用したのですか?私は常に整数の '%d'を使用していました。' NSInteger'は 'int'の単なるtypedefですが、好み以外に使う理由はありますか? –
'%i'と'%d'は 'printf'と同じものです。両方とも符号付き整数に使用されます。それはちょうど習慣の問題です。しかし、 '%i'と'%d'は 'scanf'の意味が異なります。 – Macmade
ありがとうございました。 +1 –