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

  • Home
  • SEARCH
  • 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 3721540
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:35:30+00:00 2026-05-19T05:35:30+00:00

i use a table view with custom values and image. Every rows do this

  • 0

i use a table view with custom values and image.

Every rows do this:
– Check device (iphone/ipad)
– Parse a wordpress xml
– Split this string “Thu, 13 Jan 2011 22:26:27 +0000” and get pos[1] and pos[2].
– Convert “Jan” in “Gennaio”
– set values in row cell

It’s make in this way:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {    
    @try {
        newsRow = ((NewsRowController *)[tableView dequeueReusableCellWithIdentifier:@"cell"]);
        if (newsRow == nil) {

            if ( [[Device GetModel] isEqualToString:@"iPad Simulator"] || [[Device GetModel] isEqualToString:@"iPad"])
                [[NSBundle mainBundle] loadNibNamed:@"NewsRow_ipad" owner:self options:nil];
            else [[NSBundle mainBundle] loadNibNamed:@"NewsRow" owner:self options:nil];

            if ([tableArray count] > 0) {               
                NSArray *chunks = [[dataArray objectAtIndex:indexPath.row] componentsSeparatedByString: @" "];

                [newsRow setCellDataWithName:[tableArray objectAtIndex:indexPath.row]  
                                     andDate:[descArray objectAtIndex:indexPath.row] 
                                         day:[chunks objectAtIndex:1] 
                                       month:[self convertMonthToExtended:[chunks objectAtIndex:2]]];
            }
        }       
    }
    @catch (NSException * e) {
        NSLog(@"OK, crashato. Sappiamo il perchè!");
    }

    return newsRow;
}

the function convertMonthToExtended do this:

if ([small isEqualToString:@"Jan"]) return @"gennaio";
[...]
if ([small isEqualToString:@"Dec"]) return @"dicembre";

Now, on simulator it works very fine, but on device, a 3G device in particular, when i scroll the table it scroll slowly because i do a lot of things.

How can i speed up the scroll?
What is correct way to re-implement this function to be more fast?
How can i optimize this snippet?

Any idea please?

thanks,
A

  • 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-19T05:35:31+00:00Added an answer on May 19, 2026 at 5:35 am

    I think that you can move the following code:

    if ( [[Device GetModel] isEqualToString:@"iPad Simulator"] || [[Device GetModel] isEqualToString:@"iPad"])
                    [[NSBundle mainBundle] loadNibNamed:@"NewsRow_ipad" owner:self options:nil];
                else [[NSBundle mainBundle] loadNibNamed:@"NewsRow" owner:self options:nil];
    

    Outside the tableView:cellForRowAtIndexPath: method because you don’t need to do this check for every row (the device doesn’t change from line to line). And you can put this code in viewDidLoad .

    I suggest you do all the computations and the work of asynchronous network.
    You can precomputare all the information you need to populate the rows and save them in such a NSArray while viewing a UIProgressView or something like that, only after all the operations populate the table view.
    You can use the [Tableview reloadData] method to reload all data in the table view, this mean that numberOfSectionsInTableView: , tableView:numberOfRowsInSection:, and all the data source method are recalled.

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

Sidebar

Related Questions

I have a foreach based table in my MVC partial view: <% foreach (var
Note: I'm using iPhone SDK 3.0 Final Version for Leopard. I need to prepare
I intend to implement Martin Fowler's Two-Step View Pattern for rendering HTML in a
Background: Customer X has a CCK-based Content Type (vendorxxentry) and is using Views2 to
I have an application I'm working on, and I need the user to be
I have a textField inside a tableViewCell. I recently noticed that if I enter
Hey guys, I have an application that I want to display some data from
I am a current web2py user, but find I still go back to Django
In a Django application, I want to display a multi-level (but fixed-depth) tree of
im in the beginning of the complete restyle of an my web application, and

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.