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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:14:30+00:00 2026-05-23T23:14:30+00:00

-When I call-in my strings the data is not computing and I receive errors.

  • 0

-When I call-in my strings the data is not computing and I receive errors. Is it my coding (as seen below)? Is it possible to have 3 fields of data and the ans be the sum of the lowest 2 integers of the 3? This is killing my brain. (I’ve declared the optional integers for X,Y,Z) HELP! Thank you.

-(I’m synthesizing 2 separate TextFields (last,second,&third) and the same goes for labels and strings. I am also synthesizing the final field where the calculation should appear and that is totalTextField, totalLabel, totalString).

#import "EquationViewController.h"

@implementation EquationViewController

@synthesize lastTextField, lastLabel, lastString;
@synthesize secondLastTextField, secondLastLabel, secondLastString;
@synthesize thirdLastTextField, thirdLastLabel, thirdLastString;
@synthesize totalTextField, totalLabel, totalString;

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)viewWillAppear:(BOOL)animated
{
        lastLabel.text = lastString;
        secondLastLabel.text = secondLastString;
        thirdLastLabel.text = thirdLastString;
}

    - (void) viewWillDisappear:(BOOL) animated
{
}


- (void)textFieldDidEndEditing:(UITextField *)textField
{
  lastLabel.text = [[NSString alloc] initWithFormat:@"Last", lastTextField.text];
    secondLastLabel.text = [[NSString alloc] initWithFormat:@"2nd Last", secondLastTextField.text];
    thirdLastLabel.text = [[NSString alloc] initWithFormat:@"3rd Last", thirdLastTextField.text];
    totalLabel.text = [[NSString alloc] initWithFormat:@"Total", totalTextField.text];


#include <stdio.h>
    int main ();
    {   
        double X,Y,Z,ans;
        X = 3;
        Y = 1.5;
        Z = 99;

        ans = (X+Y+Z) - MAX(X,MAX(Y,Z));
  • 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-23T23:14:30+00:00Added an answer on May 23, 2026 at 11:14 pm

    Well, if I got the problem you’d like to have the sum of the lowest two integer printed out (I didn’t understand if in a textField or in a label).
    These three numbers should be set by the user in lastTextField,secondTextField and thirdTextField.
    If this is correct (and the delegate is set properly for all the textFields) you can perform your operation in your - (void)textFieldDidEndEditing:(UITextField *)textField method.

    To get the value in the textField you can call the intValue method of the text property of the textField, i.e.

    [[lastTextField text] intValue];
    

    (the same way you can call doubleValue, floatValue and so on).
    This way you can access the values in the textFields.

    To update the final result you should call the setText: method of totalTextField (the method is the same if you want to update totalLabel). i.e. if you saved your result in a int called res, you can call

    [totalTextField setText:[NSString stringWithFormat:@"%d", res]];
    

    Hope it helps

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

Sidebar

Related Questions

I need to call into a Win32 API to get a series of strings,
I want to send some strings in a list in a POST call. eg:
I have a big string (let's call it a CSV file, though it isn't
I've a python script that after some computing will generate two data files formatted
I have a simple data structure which is serialized and deserialized. Upon deserialization, I
I have an Access 2003 project in which all data is stored in SQL
Ok, i have always wondered if these 2 actions are possible: To manipulate cookies.
Well, I am not alone who is being sick of magical strings which are
am having problem in Saving some data in my Java code. I have like
I have a class extracting strings from a large file (100,000) lines and wanted

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.