Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

objective C question

PlasticManPlasticMan Member Posts: 2
Alright this will most likely aptly display my lack of programming prowess but I am trying to teach myself objective c and I am programming a simple fraction program. I keep getting this as the output! Can anybody tell me why or what I can do to fi it?

//
// main.m
// prog3.4
//
// Created by Atticus Foller on 3/23/13.
// Copyright (c) 2013 AtticusFoller. All rights reserved.
//

#import

//----@interface section----

@interface Fraction: NSObject

-(void) print;
-(void) setNumerator: (int) n;
-(void) setDenominator: (int) d;
-(int) numerator;
-(int) denominator;

@end

//---@implementation section---

@implementation Fraction
{
int numerator;
int denominator;
}

-(void) print
{
NSLog (@%i/%i, numerator, denominator);
}

-(void) setNumerator:(int)n
{
numerator = n;
}

-(void) setDenominator:(int)d
{
denominator =d;
}

-(int) numerator
{
return numerator;
}

-(int) denominator
{
return denominator;
}

@end

//----Program section----

int main (int argc, char *argv[])
{
@autoreleasepool {
Fraction *myFraction = [[Fraction alloc] init];

[myFraction setNumerator: 1];
[myFraction setDenominator: 3];

NSLog (@The value of myFraction is: %i/%i, [myFraction numerator], [myFraction denominator]);

}
return 0;
}


output:(lldb)

What does this mean? No errors and this lldb thing. Is it a setting or an error?
Sign In or Register to comment.