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

The Archive Base Latest Questions

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

I have an html file that I want to dynamically edit before displaying to

  • 0

I have an html file that I want to dynamically edit before displaying to change some of the values.

I get the file fine, then replace the text I want, still fine. But when I convert it back to a NSURL it shows NULL and WebKitErrorDomain error 101.

Here is the code:

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"];
NSURL *theURL = [NSURL fileURLWithPath:filePath isDirectory:NO];
NSError *error;
NSString* text = [NSString stringWithContentsOfURL:theURL encoding:NSASCIIStringEncoding error:&error];

NSString  *newURL = @"SRC=\"http://75.25.157.90/nphMotionJpeg?Resolution=640x480&Quality=Standard\"";

text = [text stringByReplacingOccurrencesOfString:@"__SRC__" withString:newURL] ;

NSURLRequest *newRequest = [ [NSURLRequest alloc] initWithURL: [NSURL URLWithString:text] ]; 
[web loadRequest:newRequest];

I have “__SRC__” in the html file and I want to replace it with the newURL string above…

Any pointers would be great. I’ve tried everything I can think of…

—- Added HTML code —-

<HEAD>
<META HTTP-EQUIV="expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<TITLE>ImageViewer</TITLE>
<META http-equiv="Content-Script-Type" content="text/javascript">
<META http-equiv="Content-Style-Type" content="text/css">
</HEAD>

<BODY onLoad="setParam();play();" BGCOLOR="#EFEFEF" TEXT="#ffffff" 
LINK="#ffffff" VLINK="#ffffff"          ALINK="#ffffff" TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0"           MARGINWIDTH="0">

<INPUT TYPE=hidden NAME="Width" VALUE="640">
<INPUT TYPE=hidden NAME="Height" VALUE="480">
<INPUT TYPE=hidden NAME="Language" VALUE="0">
<INPUT TYPE=hidden NAME="Direction" VALUE="Direct">
<INPUT TYPE=hidden NAME="PermitNo" VALUE="514861200">
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD><INPUT TYPE=image NAME="NewPosition" __SRC__ WIDTH=320 HEIGHT=240 BORDER=0></TD>
</TR>
</TABLE>

</BODY>
</HTML>
  • 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-25T23:39:09+00:00Added an answer on May 25, 2026 at 11:39 pm

    You can’t turn html source back into a URL.

    You can sent the updated html to a UIWebView to display.

    - (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL
    

    Or you could server it with a web server.

    But perhaps there is a terminology breakdown and I don’t understand what the html is, please post it or at least a sample.

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

Sidebar

Related Questions

I have a html file that I want to trim. I want to remove
I have some static html content (included on a dynamically generated page) that I
I have HTML in a file that I want to remove. Here are the
I have an .html file (X) that depending on some value should immediately open
I have a number of div s in my HTML file that are dynamically
1)I have an XML file with the structure that I don't want really change.
I have a HTML file that has code similar to the following. <table> <tr>
I have a html file that has invoice details I would like to know
I have a html file that contains urls that start with ftps, http, https,
I'm new to DOM parsing in PHP: I have a HTML file that I'm

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.