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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:50:21+00:00 2026-05-26T01:50:21+00:00

I have two UITextFields one field is RISK and other is WIN. Now when

  • 0

I have two UITextFields one field is RISK and other is WIN. Now when user start writing in RISK field then it should accordingly calculate the value of WIN and should be filled in WIN field. Formula is this

    if (a<0) {
        WIN = RISK/(-a/100)

    }
    else {
                    WIN = RISK*(a/100)
    }

and if value is entered in WIN then it should populate the value in RISK, formula is
if (a<0) {

        RISK = WIN*(-a/100)
    }
    else {
        RISK= WIN*(100/a)

    }

so please guys guide me how can i populate the fields without pressing any button and how can i calculate the values?
Thanx in advance

  • 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-26T01:50:21+00:00Added an answer on May 26, 2026 at 1:50 am

    Assuming you have a property for each field:

    @property (nonatomic, retain) IBOutlet UITextField win;
    @property (nonatomic, retain) IBOutlet UITextField risk;
    

    and IBAction methods:

    - (IBAction) winDidChange: (id) sender;
    - (IBAction) riskDidChange: (id) sender;
    

    Hook these up in interface builder to the Editing Changed event:

    enter image description here

    Your method will look something like:

    - (IBAction) winDidChange: (id) sender
    {
       float winValue = [self.win.text floatValue];
       float riskValue = <your calculation here>
       self.risk.text = [NSString stringWithFormat: @"%f", riskValue];
    
    }
    

    .. and similarly for riskDidChange:

    If you hook up the Editing Changed event of the win field to the winDidChange: IBAction in interface builder (and the same for risk), the method will be called every time a character is typed into the field.

    You should read The Target-Action Mechanism section in http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html

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

Sidebar

Related Questions

i have an if statement comparing two NSStrings, one is user input from a
I have two UITextField one for Portrait and other for Lanscape View but I
i have a class c. i have other two classes a and b. now
I have one strange problem.I have two UItextfields in my view and a button.When
I have a form with two UITextFields and a button. The user enters values
I have two textFields where the user types into some words. Then, when pressing
I have two UITextFields in the App as IBOutlets and I have made a
I have two applications written in Java that communicate with each other using XML
I have two classes, and want to include a static instance of one class
I have two threads, one needs to poll a bunch of separate static resources

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.