1
WWDC#2010のTableViewUpdatesサンプルコードのTVAnimationGesturesを見ています。そのビューコントローラのサブクラスでは、彼らはこのようなアウトレットがあります。UITableViewCellのサブクラスで、そのUITableViewCellのプロパティとして保持または割り当てますか
@property (nonatomic, assign) IBOutlet QuoteCell *quoteCell;
をして、彼らのcellForRowAtIndexPathでそれを作成するには:彼らは財産アサインを使用代わりに保持なぜ
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
static NSString *QuoteCellIdentifier = @"QuoteCellIdentifier";
QuoteCell *cell = (QuoteCell*)[tableView dequeueReusableCellWithIdentifier:QuoteCellIdentifier];
if (!cell) {
UINib *quoteCellNib = [UINib nibWithNibName:@"QuoteCell" bundle:nil];
[quoteCellNib instantiateWithOwner:self options:nil];
cell = self.quoteCell;
self.quoteCell = nil;
if ([MFMailComposeViewController canSendMail]) {
UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
[cell addGestureRecognizer:longPressRecognizer];
[longPressRecognizer release];
}
else {
NSLog(@"Mail not available");
}
}
Play *play = (Play *)[[self.sectionInfoArray objectAtIndex:indexPath.section] play];
cell.quotation = [play.quotations objectAtIndex:indexPath.row];
return cell;
}
私の質問はありますか?ありがとう。