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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:09:57+00:00 2026-05-24T19:09:57+00:00

Consider the following code: Here is my price calculator controller header file. #import <Foundation/Foundation.h>

  • 0

Consider the following code:

Here is my price calculator controller header file.

#import <Foundation/Foundation.h>
#import "PriceCalculator.h"

@interface PriceCalculatorController : UITextField {

    IBOutlet UITextField *mpgField;
    IBOutlet UITextField *milesField;
    IBOutlet UITextField *priceField;
    IBOutlet UITextField *ridersField;
    IBOutlet UITextField *splitField;

    PriceCalculator *calculator;
}


-(IBAction)calculator:(id)sender;

@end

Here is its implementation file:

#import "PriceCalculatorController.h"

@implementation PriceCalculatorController


- (IBAction)calculator:(id)sender {

    float split;

    calculator = [[PriceCalculator alloc]init];


    [calculator setMpg:[mpgField float]];
    [calculator setRiders: [ridersField float]];
    [calculator setMiles: [milesField float]];
    [calculator setPrice: [priceField float]];


    split = [calculator CalculateSplit];

    [splitField setFloatValue:split];
}
@end

It’s giving me the error:

receiver type 'UITextField' for instance message does not
declare a method with selector 'float' [4]

What’s going on?

  • 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-24T19:09:58+00:00Added an answer on May 24, 2026 at 7:09 pm
    #import "PriceCalculatorController.h"
    
    @implementation PriceCalculatorController
    
    
    - (IBAction)calculator:(id)sender {
    
        float split;
    
        calculator = [[PriceCalculator alloc]init];
    
    
        [calculator setMpg:[mpgField.text floatValue]];
        [calculator setRiders: [ridersField.text floatValue]];
        [calculator setMiles: [milesField.text floatValue]];
        [calculator setPrice: [priceField.text floatValue]];
    
    
        split = [calculator CalculateSplit];
    
        [splitField setFloatValue:split];
    }
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: void foo() { { CSomeClass bar; // Some code here...
Consider the following code (from here , with the number of tests increased): from
Consider the following code sample: interface IData { int Count(); } interface IOperations {
Consider the following code. Here, A a(B()) compiles even though the constructor is A(B&
Consider the following code, integral to my questions below: import functools N = 3
Consider the following code: (live example here ) $(function() { var wrapper = $(<div
Consider the following code: from PIL import Image, ImageDraw, ImageFont def addText(img, lTxt): FONT_SIZE
Consider the following code: ( Live demo here - Open in Internet Explorer 7
Consider the following code : HTML: <div id='button' class='enabled'>Press here</div> <div id='log'></div> CSS: #button
Consider the following code : HTML: <input type='checkbox' /> <div>Click here</div> JS: $(function() {

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.