The 4 warnings are on Letter.m 2 on line 15, and 2 on line 19
Letter.h
#import <Foundation/Foundation.h>
//------@interface section---------
@interface Letter : NSObject
{
char c;
char d;
}
-(void) setC: (char) c;
-(void) setD: (char) d;
-(char) c;
-(char) d;
@end
Letter.m
#import "Letter.h"
//-----@implementation section-----
@implementation Letter
-(void) print
{
NSLog(@"%c C %c D", c, d);
}
-(void) setC:(char)c
{
c = c;
}
-(void) setD:(char)d
{
d = d;
}
-(char) c
{
return 'd';
}
-(char) d
{
return c;
}
@end
Letter1.m
#import <Foundation/Foundation.h>
#import "Letter.h"
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
/* 4.3 What output would you expect from the folowing program? */
//---Test and Run Here----
Letter *myLetter = [[Letter alloc] init];
[myLetter setC: 'c'];
[myLetter setD: 'd'];
NSLog(@"d = %c", 'd');
[myLetter release];
[pool drain];
return 0;
}
Letter1 - Debugger Console Output:
2010-03-08 19:43:59.604 Letter1[26664:a0f] d = d
OOPS - sorry about that here is the corrected Letter.h @interface section