delete in tableView..
Posted
by totato
on Stack Overflow
See other posts from Stack Overflow
or by totato
Published on 2010-04-28T06:40:51Z
Indexed on
2010/04/28
6:43 UTC
Read the original article
Hit count: 299
iphone-sdk
I just add this methods in .h file :
- (IBAction)EditTable:(id)sender;
- (IBAction)DeleteButtonAction:(id)sender;
and in .m file :
(IBAction)DeleteButtonAction:(id)sender{ [tableList removeLastObject]; [Table reloadData]; }
(IBAction) EditTable:(id)sender{
if(self.editing)
{
[super setEditing:NO animated:NO]; [Table setEditing:NO animated:NO]; [Table reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Edit"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStylePlain];
}
else {
[super setEditing:YES animated:YES]; [Table setEditing:YES animated:YES]; [Table reloadData]; [self.navigationItem.leftBarButtonItem setTitle:@"Done"]; [self.navigationItem.leftBarButtonItem setStyle:UIBarButtonItemStyleDone];
}
}
when I run the program and click the delete button (red button) the program is stop ! whats the problem ? please any help ?
© Stack Overflow or respective owner