Why I can't called 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:03 UTC
Read the original article Hit count: 222

This is my DrawSomethingCmd:

#import "Command.h";


@interface DrawSomethingCmd : Command {
}
-(void)doSomething;
-(void)execute;
@end

and the DrawSomethingCmd.m's doSomething method is like that:

-(void)doSomething{
    NSLog(@"did");
}

The Command.h:

#import <Foundation/Foundation.h>

@interface Command : NSObject {

}
-(void)execute;

And the Command.m:

#import "Command.h"


@implementation Command
-(id)init{
    return self;
}

-(void)execute{

}
@end

And I have the method like this:

    DrawSomethingCmd *tempCmd = [[DrawSomethingCmd alloc] init];

    [tempCmd doSomething];

But my Console did't show any things on that, what's going on?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone-sdk