Я изучаю Obj-C и собираюсь сделать свой первый UITableView с текстом "Hello world".
Моя проблема в том, что я не могу показать на экране правую кнопку редактирования. это мой код:
- (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];
}
[[cell textLabel] setTextAlignment:(UITextAlignmentCenter)];
cell.textLabel.text=@"Hello World";
//[cell.textLabel setText:@"Hola2"];
return cell;
}
и
- (void)viewDidUnload
{
[super viewDidUnload];
self.navigationItem.rightBarButtonItem=self.editButtonItem;
}
Я что-то упустил?
Спасибо за помощь.