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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:39:18+00:00 2026-06-09T23:39:18+00:00

Since I do not quite understand how the HTML is read before the page

  • 0

Since I do not quite understand how the HTML is read before the page is displayed, is it possible for ObjC to search for a string in the head of a HTML document and then comment it out if the string is present before the HTML opens in a UIWebView?

If so, can you give a snippet?

  • 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-09T23:39:19+00:00Added an answer on June 9, 2026 at 11:39 pm

    You can build your HTML string however you want to, and then set it to the UIWebView like this:

    [webView loadHTMLString:html baseURL:nil];
    

    As for parsing the string itself, NSMutableString has a nifty method that will help out a lot. This is what I use:

    [html replaceOccurrencesOfString:@"<div>Hello</div>" withString:@"<!--div>Hello</div-->" options:NSLiteralSearch range:NSMakeRange(0, [html length])];
    

    So if there is something that you are consistently looking for, you can replace it with something that is commented out and then set that to the webView.

    Hope that helps!

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

Sidebar

Related Questions

I know it is still not quite popular, since the spec was released just
Don't quite understand why this copy constructor is not invoked when I build with
I'm writing a wide component infrastructure, to be used in my projects. Since not
I am not sure my title is correct or not since I have no
Since Intellij does not yet support the Play-Scala-Template-Engine I was thinking about using plain
Since JavaScript is not derived from Java, why does it have Java in the
Since I'm not an Php programmer I have to ask you, I have to
Since CCKeyDerivationPBKDF is not available until after iOS 5.0, people have suggested using the
Newbie question since I'm not up to speed using maven at all. I'm trying
Hope this question is not stupid since I am an amateur web designer. I

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.