我想要获得一个添加按钮来添加行到一个表,然后可以编辑 我得到预期的标识符或'('行10, 17,和30以下是代码:期望的标识符或'('在xcode 4.6.1
- (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
是的......你找到答案:) +1 – 2013-04-10 18:43:12