my code looks like this:
In the console i get this error:
what do i do?
Code:
//
// main.m
// prog2
//
// Created by MB on 10/24/08.
// Copyright TopTechPro 2008. All rights reserved.
//
#import <stdio.h>
#import <objc/Object.h>
//-----------@interface----------------
@interface Fraction: Object
{
int numerator;
int denominator;
}
-(void) print;
-(void) setNumerator: (int) n;
-(void) setDenominator: (int) d;
@end
//-----------@implementation----------------
@implementation Fraction;
-(void) print
{
printf (" %i/%i ", numerator, denominator);
}
-(void) setNumerator: (int) n
{
numerator = n;
}
-(void) setDenominator: (int) d
{
denominator = d;
}
@end
//------------program section----------------
int main (int argc, char *argv[])
{
Fraction *myFraction;
//Create an instance of a Fraction
myFraction = [Fraction alloc];
myFraction = [Fraction init];
//Set Faction to 1/3
[myFraction setNumerator: 1];
[myFraction setDenominator: 3];
//Dsplay the fraction using print method
printf ("The value of the fraction is:");
[myFraction print];
printf ("\n");
[myFraction free];
return 0;
}
In the console i get this error:
Code:
[Session started at 2008-10-27 22:46:22 -0700.]
2008-10-27 22:46:22.268 prog2[7909:10b] *** NSInvocation: warning: object 0x3020 of class 'Fraction' does not implement methodSignatureForSelector: -- trouble ahead
2008-10-27 22:46:22.269 prog2[7909:10b] *** NSInvocation: warning: object 0x3020 of class 'Fraction' does not implement doesNotRecognizeSelector: -- abort
[Session started at 2008-10-27 22:46:22 -0700.]
Loading program into debugger
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/mb/Desktop/prog2/build/Debug/prog2.app/Contents/MacOS/prog2', process 7909.
(gdb)
what do i do?