Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 950999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:39:32+00:00 2026-05-15T23:39:32+00:00

Hi i received 2000 of datas from udp and display the values in tableview

  • 0

Hi i received 2000 of datas from udp and display the values in tableview .What is the easiest method to do this ?

Now i am using Two nsthreads and one thread for receive data via udp and stores it in NSMutableDictionary.Another thread update the tableview using these Dictionary values. But it crashes my app.

Here is some code i used

I stored Received values like this

 NSMutableDictionary *dictItem
 CustomItem *item = [[CustomItem alloc]init];
 item.SNo =[NSString stringWithFormat:@"%d",SNo];
 item.Time=CurrentTime;
 [dictItem setObject:item forKey:[NSString stringWithFormat:@"%d",SNo]];
 [item release];

Delegate method i used and i used CustomTableCells to display data as column vice.

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
    return [dictItem count];
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *identifier = @"CustomTableCell";
    CustomTableCell *cell = (CustomTableCell *)[tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) 
    {
        cell = [[[CustomTableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
    }
    NSArray *keys = [dictItem allKeys];
    CustomItem *item = [dictItem objectForKey:[keys objectAtIndex:indexPath.row]];
    cell.SNo.text = item.SNo;
    cell.Time.text  = item.Time;
    return cell;
}

The errror is

Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘*** Collection was mutated while being enumerated.’
2010-07-23 02:33:07.891 Centrak[2034:207] Stack: (
42162256,
43320108,
42161198,
43372629,
41719877,
41719345,
9948,
3276988,
3237662,
3320232,
3288478,
71153942,
71153189,
71096786,
71096114,
71296742,
41650770,
41440069,
41437352,
51148957,
51149154,
2925426
)
terminate called after throwing an instance of ‘NSException’

Can anyone help me ?

Thanks in advance…….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:39:33+00:00Added an answer on May 15, 2026 at 11:39 pm

    You probably have to use locking because when you access your dictionary from table view, it perhaps being mutated with other thread.
    Try to look at NSLock docs. Before mutating your dictionary do [myLock lock]; and after mutating do [myLock unlock];. Similar in other thread: before enumerating dictionary do [myLock lock]; and after getting all values do [myLock unlock];.
    myLock is a NSLock object and must be shared between your threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I received >>> THIS <<< error log from a client. I replaced the app
How to set Alarm Tone from My Application using AlarmManager? My RingTonePicker Method:- private
I am new to this Claims and SAML concept. I am using WIF from
Received a strange error when using secure websockets in Safari with Webbit server. Error
I received this error on following code.Is this + sign is not available in
I received the error while trying to display some variable like so: echo id
Had received a module from CCAVENUE and it was working fine with Magento 1.6.2...
I received DateTime String from Fedex in following format 2012-06-22T21:39:48-05:00 I want to convert
anyone using ffmpeg I have a fairly simple wmv exported by a user from
I need to count amount of bytes sent and received from the network by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.