Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

text data is not displaying quickly (taking time in update) after reload tableview #75

Open
sandy-srma opened this issue May 1, 2014 · 5 comments

Comments

@sandy-srma
Copy link

Hi Alex,
In background thread m creating a NSBubbleData instance with dataWithText and add it to inside mutable array after that when m reload my tableview in main thread , immediately bubble appear but text visible after 8-10 sec , i debug my code several times to find out whether data is proper coming or not ..but found nothing .

screen shot 2014-05-01 at 4 05 29 pm

and bubble is also not consistent not draw in circular way .
Any idea please help me .

Thanks
Sandy

@lewisrichardson2103
Copy link

I have had this problem too. I am using multipeer connectivity and the weird thing is that it updates perfectly for sent data but not received. I have debugged and logged and the text has been received...just not displayed for an amount of time. Sometimes over a minute.

@lewisrichardson2103
Copy link

Solved,
Use :
[self performSelectorOnMainThread:@selector(newMessageReceived) withObject:Nil waitUntilDone:No];

-(Void) newMessageReceived{
.....
}

@sandy-srma
Copy link
Author

Hi Alex ,
it's not working , getting same problem.
My codesnipet.

NSBubbleData *heyBubble = [NSBubbleData dataWithText:[NSString
stringWithFormat:@"%@ wrote:\n%@\n\n", peerDisplayName, receivedText]
date:nil type:BubbleTypeSomeoneElse];
[_ChatData addObject:heyBubble];
[self performSelectorOnMainThread:@selector(newMessageReceived)
withObject:Nil waitUntilDone:NO];

-(void)newMessageReceived
{
[_tblChatList reloadData];
}

Any idea what is going wrong with me.
Thanks
Sandeep Sharma

On 04/05/14 5:00 am, lewisrichardson2103 wrote:

Solved,
Use :
[self performSelectorOnMainThread:@selector
https://github.com/Selector(newMessageReceived) withObject:Nil
waitUntilDone:No];

-(Void) newMessageReceived{
.....
}


Reply to this email directly or view it on GitHub
#75 (comment).

Regards,
Sandeep Sharma
HyTech Professionals
An ISO 9001:2008 Certified Company
Phone(US): +1-(302) 355 0436
Phone(India):+91-120-4223960, Ext. 226
Email: sandeep.sharma@hytechpro.com
Skype: hytechpro_sandeep_sharma1
Website: http://www.hytechpro.com

@lewisrichardson2103
Copy link

recievedText = ......;
[self performSelectorOnMainThread:@selector(newMessageReceived)
withObject:Nil waitUntilDone:NO];

-(void)newMessageRecieved
{
NSBubbleData *heyBubble = [NSBubbleData dataWithText:[NSString
stringWithFormat:@"%@ wrote:\n%@\n\n", peerDisplayName, receivedText]
date:nil type:BubbleTypeSomeoneElse];
[_ChatData addObject:heyBubble];
[_tblChatList reloadData]
}

on a side note if I have found
[_tblChatList performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
is more efficient than using [_tblChatList reload]

@sandy-srma
Copy link
Author

Thanks Alex,
Would you like to share your linked in or Facebook id with me please.

Regards

Sandeep Sharma

On 05/05/14 2:25 pm, lewisrichardson2103 wrote:

recievedText = ......;
[self performSelectorOnMainThread:@selector
https://github.com/selector(newMessageReceived)
withObject:Nil waitUntilDone:NO];

-(void)newMessageRecieved
{
NSBubbleData *heyBubble = [NSBubbleData dataWithText:[NSString
stringWithFormat:@"%@ wrote:\n%@\n\n", peerDisplayName, receivedText]
date:nil type:BubbleTypeSomeoneElse];
[_ChatData addObject:heyBubble];
[_tblChatList reloadData]
}

on a side note if I have found
[_tblChatList performSelectorOnMainThread:@selector
https://github.com/selector(reloadData) withObject:nil
waitUntilDone:NO];
is more efficient than using [_tblChatList reload]


Reply to this email directly or view it on GitHub
#75 (comment).

Regards,
Sandeep Sharma
HyTech Professionals
An ISO 9001:2008 Certified Company
Phone(US): +1-(302) 355 0436
Phone(India):+91-120-4223960, Ext. 226
Email: sandeep.sharma@hytechpro.com
Skype: hytechpro_sandeep_sharma1
Website: http://www.hytechpro.com

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

No branches or pull requests

2 participants