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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:34:05+00:00 2026-06-11T00:34:05+00:00

I am trying to make a calculator app for iphone so now i finished

  • 0

I am trying to make a calculator app for iphone
so now i finished all operations and i want to make if the user typed in the text field his first number and then if he tapped the ‘+’ button i want the test field switch or tab to the another text field

so how can i do it ?
here is the header

    #import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
    int a,b,c;
    char op;
    UILabel*operation,*result;
    UITextField *num1,*num2;  
}
@property (nonatomic)int a , b ,c;
@property (nonatomic)char po;
@property (nonatomic ,retain)IBOutlet UILabel*operation,*result;
@property (nonatomic ,retain)IBOutlet UITextField *num1,*num2;;

-(IBAction)sum:(id)sender;
-(IBAction)Calculate:(id)sender;
-(IBAction)Clear:(id)sender;
-(IBAction)hideKeyboard:(id)sender;
@end

.m file

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize operation,result,num1,num2,a,b,c,po;
-(IBAction)sum:(id)sender{
    operation.text=@"+";


}
-(IBAction)hideKeyboard:(id)sender{
    [num1 resignFirstResponder];   
    [num2 resignFirstResponder];
}
-(IBAction)Calculate:(id)sender{

    //sum
    a =num1.text.integerValue;
    b= num2.text.integerValue;
    c=num1.text.integerValue+num2.text.integerValue;
    printf("%i >> %i",b,num2.text.integerValue);
    [num1 resignFirstResponder];
    [num2 resignFirstResponder];
    result.text =[NSString stringWithFormat:@"%i + %i = %i",a,b,c];



}
-(IBAction)Clear:(id)sender{
    [num1 resignFirstResponder];
    [num2 resignFirstResponder];
    num1.text=@"";
    num2.text=@"";
    operation.text=@"";
    a=0;
    b=0;
    c=0;
    result.text=@"";
    op=' ';

}
  • 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-11T00:34:07+00:00Added an answer on June 11, 2026 at 12:34 am

    If I understand your code correctly, after the user inputs the first -sum:sender gets called. You can just call becomeFirstResponder on the second UITextField.

    -(IBAction)sum:(id)sender{
        operation.text=@"+";
        [num2 becomeFirstResponder];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a simple calculator program where a user can opt
So I'm trying to make a calculator app (just to get a hang of
I'm trying to make a calculator which is basicly like this: user enters about
I'm currently trying to make an orientation calculator in java and I'm having a
I am trying to make a BMI Calculator using HTML. The inputs come from
I'm trying to make a simple addition calculator in C to learn how to
I'm learning Objective-C and trying to make a very simple command line calculator. 'S'
I am trying to build a Retirement Calculator as a chance to make something
I'm trying make a login window where a user is prompted to enter their
I am fairly new to iOS development and trying make a simple app which

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.