Estoy intentando activar el modo de edición para una UITableView. Cuando hago clic en el botón "Editar", cambia a "Hecho", pero los signos rojos menos redondos no aparecen en la tabla. Estoy publicando a continuación algunos de los métodos de la clase. El delegado de la aplicación creó una Barra de pestañas y las vistas dentro de las pestañas tienen controladores de navegación. todo está hecho en código, poco se hace con los archivos de punta. ¿Qué pasa?Modo de edición de UITableView no funciona
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [ikub.subscriptions count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
int i = [indexPath row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
}
Subscriptions *s = [ikub.subscriptions objectAtIndex:i];
cell.textLabel.text = [s title];
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ artikuj te rinj, %@ artikujt te lexuar", [s new], [s read]];
if (deleteActive) {
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
} else {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Subscriptions *s = [ikub.subscriptions objectAtIndex:[indexPath row]];
NSString *address = [[NSString alloc] init];
NSString *type = [NSString stringWithString:[s type]];
if ([type isEqualToString:@"Category"]) {
address = [NSString stringWithFormat:@"http://www.ikub.al/Rss.aspx?node=9e26cdb8-dba6-4504-8bb6-29f0753be179~%@", [s code]];
} else if ([type isEqualToString:@"Tag"]) {
address = [NSString stringWithFormat:@"http://www.ikub.al/Rss.aspx?tag=%@", [s code]];
}
address = [address stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
SubscriptionStories *ss = [[SubscriptionStories alloc] init];
ss.address = address;
ss.title = [s title];
[self.navigationController pushViewController:ss animated:YES];
[ss release];
}
- (void)viewWillAppear:(BOOL)animated {
[subscriptionsTable reloadData];
}
- (void)viewDidLoad {
refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:nil];
self.navigationItem.leftBarButtonItem = refreshButton;
[refreshButton release];
self.navigationItem.rightBarButtonItem = self.editButtonItem;
[super viewDidLoad];
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
bueno olsi favor editar su pregunta, formateando adecuadamente. Es muy difícil entender el código. No hay espacio entre el final y el inicio de los métodos. – iPhoneDev