iOSのアプリケーションをビルドしています。私はたくさんのものを計算して、-(IBAction)calculate
の画面に表示しています。 また、カットリストとなる増分配列も作成されます。ビューの片側を空白にして空白が表示されます(UITableView
)。私はviewDidLoad
の後にそれを持っています。今私は計算ボタンを押して、私はこのリストに増加するカットリストを設定したいと思います。私はこれを手伝ってくれるチュートリアルなどは見つけられません。ボタンのタッチでUITableViewを設定する方法
計算アクションに入れるとエラーになります。 だから私はviewDidLoad
の後にそれを残して、ボタンタッチからそれを埋めることを望んでいた。
// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [creeperArray count];
}
// 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:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
[cell.textLabel setText:[creeperArray objectAtIndex:indexPath.row]];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
*/
}
よろしくお願いします。 –