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 8591145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:27:33+00:00 2026-06-11T23:27:33+00:00

I have a big issue with my current development stage on a project that

  • 0

I have a big issue with my current development stage on a project that I’m working on.

I’m have a UIScrollView which holds 50 multiline UILabels with dynamic content loaded from a localizable.string. The labels are individually formatted (font, bold, italic, color).

The problem is that the App’s real memory usage jumps to almost 70MB (live bytes 3MB) and that is just unacceptable and with my current concept I would have to use ~200 UILabels in order to achieve my goal.

What can I do ? Is there a way to lazy load the UILabels or reuse them ? Should I use UITextView or UIWebView ?

How can I do that ?

Thanks.

  • 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-06-11T23:27:34+00:00Added an answer on June 11, 2026 at 11:27 pm

    Well guys with your help, I’ve came up with this solution which works just extraordinary !

    I’m using a html “template” file with markers inside it and a UIWebView.

    Basically what I’m doing is the following:

    1. get the html file path.
    2. create a string with the contents of html template.
    3. replace the markers from the html with my strings (NSLocalized strings – lots of text).
    4. load into the WebView contents of the newly created string using “loadHTMLString”.

    Result: from a memory footprint of 70MB, now I have a memory footprint of 12MB (and that with the equivalent of ~20 A4 pages of text).

    Here’s the code:

        NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"yourhtmlfile" ofType:@"html"];
    NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
    [_webView setBackgroundColor:[UIColor clearColor]];
        [_webView setOpaque:NO];
    
    NSString *htmlBody = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF16StringEncoding error:nil];
    
    htmlBody = [htmlBody stringByReplacingOccurrencesOfString:@"//marker_1//" withString:NSLocalizedString(@"localizedKey_1", nil)];
    htmlBody = [htmlBody stringByReplacingOccurrencesOfString:@"//marker_2//" withString:NSLocalizedString(@"localizedKey_2", nil)];
    htmlBody = [htmlBody stringByReplacingOccurrencesOfString:@"//marker_3//" withString:NSLocalizedString(@"localizedKey_3", nil)];
    
    [self.webView loadHTMLString:htmlBody baseURL:baseURL];
    

    And now I can use the html goodies like text formatting 😀 !

    I hope that the above will help a lot of people 🙂 !

    Thank you guys for support !

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

Sidebar

Related Questions

I have an issue with .scrollTop() I have a page that stores the current
I have big system that make my system crash hard. When I boot up,
I have big URL list, which I have to download in parallel and check
I have big element at the top of the webpage that sides down with
I have a pretty big web application that I created last year using ASP.NET
I have an Event model that includes a start time field, which is stored
GOAL: Create element which will display current big image and few thumbnails. When somebody
I have big issue with url-rewriting for IIS 7.0. I've written simple module for
i have a big issue with dajax and jquery: i'm trying to save the
i have an issue with my current database with mysql. i have over 100

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.