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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:45:31+00:00 2026-06-03T11:45:31+00:00

I have setup a settings bundle and can successfully pull data from that. I

  • 0

I have setup a settings bundle and can successfully pull data from that. I also need to inject some code into a UIWebView which I can also successfully do. Now the question is How do I combine the 2?

I have this code to read a textField label from the setting bundle:

NSString *textField01 = [[NSUserDefaults standardUserDefaults] stringForKey:@"tetxtField01_preference"];

and i have this string to inject code into the UIWebView:

 [_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('textField01').value = 'default text'"];

Now in the stringByEvaluatingJavaScriptFromString I can inject the “default text” but then it is hardcoded into the app and I cannot change it within the app.

So is it possible and if so how do I put objective-c NSString in the place default text?

I was thinking of something along the lines of:

[_webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('textField01').value = [@"%@", textField01] "];

but it gives an error:-)

Cheers

  • 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-03T11:45:34+00:00Added an answer on June 3, 2026 at 11:45 am

    Create the Js string completely and pass it on to the “stringByEvaluatingJavaScriptFromString:” function.
    i.e

    NSString *foo = [NSString stringWithFormat:@”document.getElementById(‘textField01’).value = %@”,textField01];
    [_webView stringByEvaluatingJavaScriptFromString:foo];

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

Sidebar

Related Questions

I have setup a Symfony 2 Data Transformer that will allow the user to
In settings.py I have setup a way to log my messages like this: logging.basicConfig(
I have setup a application in my IIS7 that uses .NET Framework 4.0 (runned
I have a select menu with two options that are settings for my website.
I have setup the following in my urls.py: (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}) and my
I have setup a windows forms project to use localization so that it will
I have a call tracking application that I've built and now I need to
I have set up a preference using multi_preference in my Root.plist in my Settings.bundle
I have just setup VisualSVN on my local machine and on our server that
I have a setup program that I want to install to a local folder.

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.