Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to delete a Specific row ? #48

Open
bintu1234 opened this issue Apr 19, 2016 · 3 comments
Open

How to delete a Specific row ? #48

bintu1234 opened this issue Apr 19, 2016 · 3 comments

Comments

@bintu1234
Copy link

bintu1234 commented Apr 19, 2016

Hi I am working with this Library working Great But i need delete a particular row like after long press for that I am using Gestures below is my Gesture method

CGPoint p = [gestureRecognizer locationInView:self.tableView];
NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:p];
id message = self.conversation[indexPath.section][indexPath.row];
int index = (int)[[self messages] indexOfObject:message];
it is showing currenct index value but getting error like beyond the bounds exception. I thing it is problem with the section and rows in soMessaging but I am unable to delete that row can any body help me please

@WarisSaqi
Copy link

you extract your message from self.conversation and get index from self message
i can't understand this logic.

@bintu1234
Copy link
Author

Beacause of the sections. In that table not showing exact indexpth.row value so i am using above code it is showing exact indexpath. I am able to delete in sqlite.But getting error like beyond the bounds exception.

@WarisSaqi
Copy link

The exception beyond the bounds exception is occur when you try to access the index of array which is not present in array. For example an array contain 5 objects and you try to access the 5th index.
And i think when you delete from sqlite then you are removing it from your message array too. That is why this error occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@WarisSaqi @bintu1234 and others