Why can't I call my doSomething method?
Posted
by Tattat
on Stack Overflow
See other posts from Stack Overflow
or by Tattat
Published on 2010-04-11T07:01:48Z
Indexed on
2010/04/11
7:13 UTC
Read the original article
Hit count: 184
objective-c
|iphone-sdk
This is my DrawSomethingCmd:
#import "Command.h";
@interface DrawSomethingCmd : Command {
}
-(void)doSomething;
-(void)execute;
@end
and the DrawSomethingCmd.m's doSomething
method is:
-(void)doSomething{
NSLog(@"did");
}
The Command.h:
#import <Foundation/Foundation.h>
@interface Command : NSObject {
}
-(void)execute;
And Command.m:
#import "Command.h"
@implementation Command
-(id)init{
return self;
}
-(void)execute{
}
@end
And I have a method like this:
DrawSomethingCmd *tempCmd = [[DrawSomethingCmd alloc] init];
[tempCmd doSomething];
But my console didn't show anything. What's going on?
© Stack Overflow or respective owner