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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:40:45+00:00 2026-06-18T15:40:45+00:00

I am getting this compiler error use of undeclared identifier just like the title

  • 0

I am getting this compiler error ” use of undeclared identifier ” just like the title says. I am trying to write to a “result” a “operationPerformed” which is basically some maths equations . I am new to Xcode so don’t punish me:). Appreciate your time!

code edited accordingly

@interface CalculatorViewController ()

@end

@implementation CalculatorViewController
-(void)setOperand:(double)aDouble
{
    operand = aDouble;
}

-(double)performOperation:(NSString *)operation
{
    if ([operation isEqualToString:@"sqrt"])
    {
        operand = sqrt(operand);
    }
    else if ([operation isEqualToString:@"+/-"] && operand !=0)
    {
        operand = -1 * operand;
    }
    else if ([operation isEqualToString:@"1/x"] && operand !=0)
    {
        operand = 1.0 / operand;
    }

    else if ([operation isEqualToString:@"sin"])
    {
        operand = sin(operand);
    }
    else if ([operation isEqualToString:@"cos"])
    {
        operand = cos(operand);
    }
    else if ([operation isEqualToString:@"tan"])
    {
        operand = tan(operand);
    }
    else
    {
        [self performWaitingOperation];
        waitingOperation = operation;
        waitingOperand = operand;
    }
    return operand;
}

-(void)performWaitingOperation
{
    if ([@"+" isEqual:waitingOperation] )
    {
        operand = waitingOperand + operand;
    }
    else if ([@"*" isEqual:waitingOperation])
    {
        operand = waitingOperand * operand;
    }
    else if ([@"-" isEqual:waitingOperation])
    {
        operand = waitingOperand - operand;
    }
    else if ([@"/" isEqual:waitingOperation])
    {
        if(operand)
        {
            operand = waitingOperand / operand;
        }
    }
}

-(IBAction)operationPressed:(UIButton *)sender
{
    if (userIsInTheMiddleOfTypingANumber)
    {
        setOperand:[[display text] doubleValue];
        userIsInTheMiddleOfTypingANumber = NO;
        decimalAlreadyEnteredInDisplay = NO;
    }
    NSString * operation = [[sender titleLabel] text];
    double result = [self operformOperation:operation];
    [display setText:[NSString stringWithFormat:@"%f", result]];
}
  • 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-18T15:40:46+00:00Added an answer on June 18, 2026 at 3:40 pm

    This line:

    double result = performOperation:operation;
    

    is invalid syntax. Maybe you wanted:

    double result = [self performOperation:operation];
    

    Without more context it’s hard to say.

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

Sidebar

Related Questions

I'm trying to implement this code for accelerometer use, but I'm getting a compiler
I am getting a compiler error when I am trying to use the push_back
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
I'm getting a compiler error for this line: Collections.sort(terms, new QuerySorter_TFmaxIDF(myInteger)); My customized Comparator
Trying to compile a iPhone/iPad application with SDK3.2 and am getting this error: Undefined
I'm trying to compile the next code, but I'm getting this error on the
I'm getting a compiler error with this code: Map<String, String[]> myMap; void set(Map<String, Object>
I'm baffled by this compiler error message I'm getting. The functions addAgent and withAgent
I am trying to compile my C code but I'm getting this error, I've
I´m getting this Cannot use typeid with -fno-rtti when I´m trying to compile my

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.