Ok dont laugh, I am practicing things I've learned from an Objective C book, and I have already struck an error declaring a class and trying to make a method which outputs to console saying Hello.
What happens is, it compiles but I get one error saying NSObject may not respond to -print
This is the code:
Code:
#import <Foundation/Foundation.h>
@interface Thing : NSObject
- (void) print;
@end
@implementation Thing : NSObject
- (void) print
{
NSLog(@"Hello");
}
@end
int main() {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSObject *Thing;
Thing = [[NSObject alloc] init];
[Thing print]; //NSObject may not respond to -print warning
[Thing release];
[pool drain];
return 0;
}
Thanks in advance
Arc