テーブルに行を追加するための追加ボタンを取得しようとしています。これは編集可能です。10、17、および 30 行目で、予想される識別子または '(' を取得しています。コードは次のとおりです。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
UILabel *lblName = (UILabel *)[cell viewWithTag:100];
[lblName setText:[intervalArray objectAtIndex:[indexPath row]]];
return cell;
}
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
}
if ([indexPath section]) == 0 {
UITextField *workoutTextField = [[UITextField alloc] initWithFrame:CGRectMake(110, 10, 185, 30)];
workoutTextField.adjustsFontSizeToFitWidth = YES;
workoutTextField.textColor = [UIColor blackColor];
if ([indexPath row] == 0) {
workoutTextField.placeholder = @"...";
workoutTextField.keyboardType = UIKeyboardTypeEmailAddress;
workoutTextField.returnKeyType = UIReturnKeyNext;
}}
// Configure the cell...
return cell;
あなたの提案を試してみたところ、すべてのエラーが解消されましたが、ボタンを使用してテーブルに行を追加することはできません。テーブルに行を追加する方法についての提案は大歓迎です。これは私の最初の iOS アプリであり、プログラミング全般にかなり慣れていません。助けてくれてありがとう!OS X 10.8.3 を使用しています