In my app I need to delete multiple rows in a table, edit the table and get a check box beside the table. When checked then the table cells are deleted. It is like the iPhone message app. How can I do this, please help me.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand your question correctly, you essentially want to mark
UITableViewCells in some way (a checkmark); then, when the user taps a master “Delete” button, all markedUITableViewCells are deleted from theUITableViewalong with their corresponding data source objects.To implement the checkmark portion, you might consider toggling between
UITableViewCellAccessoryCheckmarkandUITableViewCellAccessoryNonefor theUITableViewCell‘saccessoryproperty. Handle touches in the followingUITableViewControllerdelegate method:You might also look at this post regarding custom
UITableViewCells if you’re wanting a more complex checkmark.You can set up a master “Delete” button two ways:
In either case, eventually a method must be called when the master “Delete” button is pressed. That method just needs to loop through the
UITableViewCellsin theUITableViewand determined which ones are marked. If marked, delete them. Assuming just one section:Assuming by “edit” you mean “delete a single
UITableViewCell” or “move a singleUITableViewCell,” you can implement the following methods in theUITableViewController: