通常の UIViewController で次のコードを他のコンテンツとともに使用しました。テーブル ビューはビューの下部にあります。
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [names count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"namen";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Configure the cell...
NSString *cellValue = [names objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell;
}
そして名前と呼ばれるNSMutableArray(4つのオブジェクトを持つ)