15個のセルを持つUITableViewがあり、それぞれに個別のテキストボックスがあります。UITextViewDelegateを実装しましたが、textViewDidChangeなどを使用して変更されたtextviewデータを受信できます。しかし、まだ1つの大きな問題があります。どのテキストビューがこれを送信したかをどのように知ることができますか(つまり、どのセルでテキストビューが変更されたか)。
たくさんの仕事をしているのに、それがどこから来ているのか正確にはわからないのは興味深いことです。
必要に応じて、大量のコードを利用できます。
よろしく@norskben
コード
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
//Big Text Box
UITextView *detailLabel = [[UITextView alloc] initWithFrame:CGRectMake(30, 80, CONST_Cell_width, 150)];
detailLabel.tag = 20;
[cell.contentView addSubview:detailLabel];
}
UITextView * detailLabel = (UITextView *) [cell.contentView viewWithTag:20];