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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:44:35+00:00 2026-05-23T10:44:35+00:00

Hi everyone, I am new to iphone development..I am doing some application where I

  • 0

Hi everyone, I am new to iphone development..I am doing some application where I am stuck…I am having a textfield, button and a webview..

I am having a parsed json file..

I want to enter a string or method in the textfield, which is present in the JSON file..It should match with the method in json file and should display the contents of a method on webview..

I have done with button and a webview… I want to extend further with textfield and webview..

How can we do it? Please suggest me with example code…

//code

 - (void)loadData
    {
        dataWebService = [[NSMutableData data] retain];

        NSURLRequest *request = [[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://api.kivaws.org/v1/loans/search.json?status=fundraising"]]retain];  

          [[NSURLConnection alloc]initWithRequest:request delegate:self];
    }


    -(void)connectionDidFinishLoading:(NSURLConnection *)connection
    {
        [connection release];    
        NSString *responseString = [[NSString alloc] initWithData:dataWebService encoding:NSUTF8StringEncoding];

        self.dataWebService = nil;

        NSArray* latestLoans = [(NSDictionary*) [responseString JSONValue] objectForKey:@"loans"]; 

        [responseString release];    

        NSDictionary* loan = [latestLoans objectAtIndex:0];

        //fetch the data
        NSNumber* fundedAmount = [loan objectForKey:@"funded_amount"];

        NSNumber* loanAmount = [loan objectForKey:@"loan_amount"];

        float outstandingAmount = [loanAmount floatValue] - [fundedAmount floatValue];

        NSString* name = [loan objectForKey:@"name"];

        NSString* country = [(NSDictionary*)[loan objectForKey:@"location"] objectForKey:@"country"];

        //set the text to the label
        label.numberOfLines = 0;

        label.text = [NSString stringWithFormat:@"Latest loan: %@ \n \n country:  %@ \n \n amount: $%.2f", name,country,outstandingAmount];
 }
  • 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-23T10:44:35+00:00Added an answer on May 23, 2026 at 10:44 am

    I think you are asking this: “How can I enter part of the URL in a textfield, and have it appended to a base URL and loaded into the webview?”

    If so, you can do it quite easily. If your textfield is called “textfield” and webview called “webview” then do this:

    NSString *baseUrl = @"http://whatever.com";
    NSString *fullUrl = [baseUrl stringByAppendingString:textfield.text];
    [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:fullUrl]]];
    

    Trigger it either with a button press or with UITextFieldDelegate’s - (BOOL)textFieldShouldReturn:(UITextField *)textField

    Edit:

    You want to retrieve a value from the NSDictionary that the JSON generated based on a key you specify in the textfield. First, do

    NSString *value = [dictionary objectForKey:textfield.text];
    

    to get the value (assuming it is a string here). Then you want to display the value in a webview. You can either do it with loadHTMLString:baseURL: or with javascript via stringByEvaluatingJavaScriptFromString: (both methods of UIWebView). If you want to use loadHTMLString for example you can put in

    NSString *html = [NSString stringWithFormat:@"<html><body>%@</body></html>", value];
    [webview loadHTMLString:html baseURL:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi everyone i am new to iphone development and started with some sample application.
hi everyone i am new to iphone development. Actually i am trying with some
hello everyone i am new bie in iphone development i want to connect to
i am noob and new in development iphone application so i want to create
Heloo everyone im new to android development and im developing an android application for
Hi everyone new to MVC and I need to trim some %20's off of
Hello everyone I am new to blackberry and I want a textfield that scroll
everyone! new to here and been pondering about this myself for some times with
I everyone. I'm very new to Android development and I want to develop an
hiii every one i am new to iphone development in a sample downloaded app

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.