ユーザーがデータを入力できるテーブルビューを作成しようとしています。新しい連絡先を作成するときに、iPhone の連絡先アプリとほぼ同じに見えるようにしたいと考えています。
以下にコードを投稿しました。
タイトル テキストの横にタイトルを入力してもらいたい、説明テキストの横に説明を入力してもらいたい、時間の横に時間を入力してもらいたい、そして場所テキストの横に、ユーザーに場所を入力してもらいたいです。
私はこれを行う方法について完全に迷っており、どんな助けも大歓迎です!
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
if(indexPath.row == 0) {
cell.textLabel.text = @"Title";
}
else if(indexPath.row == 1) {
cell.textLabel.text = @"Description";
}
else if(indexPath.row == 2) {
cell.textLabel.text = @"Time:";
}
else if(indexPath.row == 3) {
cell.textLabel.text = @"Location:";
}
// Configure the cell...
return cell;
}