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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:11:12+00:00 2026-06-06T05:11:12+00:00

I have an IBAction instance method that is connected to a slider, and displays

  • 0

I have an IBAction instance method that is connected to a slider, and displays the slider value in a Text Field that has the name datacellR1. A copy of the code is below, followed by a question. Both methods are in the @implementation section of the View2Controller.m file.

- (IBAction)slider1Change:(id)sender 
{

    float pctVal1 = [slider1 floatValue];  // this works
    [datacellR1 setFloatValue:pctVal1];         

   [View2Controller CalculateUpdatedTotal ]; // This method needs to work with the datacellR1 contents, but I can’t access it.


}



-(void)CalculateUpdatedTotal  
{  

    // -------- do some work with datacellR1 ----
    // This function fails with an error

    float newValue = [datacellR1 floatValue];

    //some other code goes here   

}

The error in slider1Change is that CalculateUpdatedTotal method is not found. If I change CalculateUpdatedTotal from an instance method to a class method, the error is that the Instance variable datacellR1 accessed in a class method.

Any suggestions on how I can make this work?

  • 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-06T05:11:13+00:00Added an answer on June 6, 2026 at 5:11 am

    CalculateUpdatedTotal, as written, is also an instance method. Therefore, to invoke it, you should pass the message to self, not the class (View2Controller):

    [self CalculateUpdatedTotal];
    

    By the way, it’s conventional to begin method names in Objective-C with a lower-case letter.

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

Sidebar

Related Questions

Say for instance I have an IBAction that is hooked up to a UIButton
I need to call a method I have defined as: -(IBAction)next:(id)sender{ ... } I
I have some code as shown below: - (IBAction)startButtonPressed:(id)sender { statusText.text = @Processing...; //here
I have this method (someone else wrote it!) - (IBAction)showMasterPopover:(id)sender { if (_hiddenPopoverController &&
I have two interfaces: IState and IAction . A State has a method: GetActions
Have data that has this kind of structure. Will be in ascending order by
lets say I have an NSWindow Class, that has several events for mouse and
I have an NSString that as an instance variable within my appdelegate as below:
Question 1: how do I have an instance variable make a permanent copy of
I have an app where i have an IBAction which recognizes a tap gesture

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.