Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Objective-C Basics Basic Data Types and Variables Numerical Data Types: ints, floats and doubles

Vanessa Noel
PLUS
Vanessa Noel
Courses Plus Student 263 Points

code won't say anything other than hello world when run

I follow the instructions on the screen perfectly but everytime I run my program it says hello world; I tried erasing that part but then nothing works. Please help

Jeff Ripke
Jeff Ripke
41,989 Points

Can we see your code?

int main(int argc, const char * argv[]) { @autoreleasepool {

    //string
    /*
    NSString *firstName;
    firstName = @"Jaime";

    NSLog(@"Your name is %@ ", firstName);
    */

    //int
    int curretAge;
    curretAge = 36;

    float currentWeight;
    currentWeight = 124.75;

    float currentHeight;
    currentHeight = 66.0;

    double currentWeightPerInch;
    currentWeightPerInch = currentWeight / currentHeight;

    NSLog(@"Current Height is %f", currentHeight);
    NSLog(@"Current Weight is %f", currentWeight);
    NSLog(@"Current WeightPerInche is %f", currentWeightPerInch);
}
return 0;

}

Jeff Ripke
Jeff Ripke
41,989 Points

I do not see anything wrong with that code. Maybe shut down Xcode and try again. You can try pressing command-shift-k... Also when you post code if you can use 3 ticks and the name of the laungage (`objectivec) and end with 3

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {

    int curretAge;
    curretAge = 36;

    float currentWeight;
    currentWeight = 124.75;

    float currentHeight;
    currentHeight = 66.0;

    double currentWeightPerInch;
    currentWeightPerInch = currentWeight / currentHeight;

    NSLog(@"Current Height is %f", currentHeight);
    NSLog(@"Current Weight is %f", currentWeight);
    NSLog(@"Current WeightPerInche is %f", currentWeightPerInch);

    return 0;
}