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

Application crashes #8

Open
HB-Dimple opened this issue Oct 1, 2015 · 2 comments
Open

Application crashes #8

HB-Dimple opened this issue Oct 1, 2015 · 2 comments

Comments

@HB-Dimple
Copy link

Application crashes after many messages are entered.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'

This could be a simple fix. Check MessageController.m line number 210.

[self.tableView beginUpdates];
if ([self.tableArray numberOfMessagesInSection:indexPath.section] == 1)
    [self.tableView insertSections:[NSIndexSet indexSetWithIndex:indexPath.section]
                  withRowAnimation:UITableViewRowAnimationNone];
[self.tableView insertRowsAtIndexPaths:@[indexPath]
                      withRowAnimation:UITableViewRowAnimationBottom];
[self.tableView endUpdates];

There is an unbalanced call here.

Apart from that, I found this sample code was too slow. I am not sure why but I did'nt investigated.

@rcmstark
Copy link
Owner

rcmstark commented Oct 1, 2015

Most of people that test this library try to add 200 messages just to start. To add a lot of messages you need to add 20 by 20, as whatsapp does. I don't create the code to page it, but is the right thing to do for a lot of messages.

I don't what test you did but you are passing nil object somewhere.

Maybe I move this git to my Messenger.framework that is a complete chat system. This library is just the interface, but i'm not sure if I will make the framework open source.

@HB-Dimple
Copy link
Author

I hardly added 10 messages. I know it is caused by nil param that is passed.

Also issue is not with pagination. If you keep your whats app open and type more than 50 messages, then it will show all messages that were already there. If you go back and come again, then it paginates.

This is due to inappropriate management of rows being added due to animation. Check with animation and you can solve that issue. And yes, I didnt changed any thing in your code, I was just playing around it to know if I can grab this code. But any way I have started my own code.

Cheers.

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

2 participants