What's wrong with my sub-classed AVAudioPlayer?
I sub-classed AVAudioPlayer like so:
#import <AVFoundation/AVFoundation.h>
@interface AudioPlayer : AVAudioPlayer {
// irrelevant objects...
}
-(void) myMethod;
@end
I also placed myMethod in the implementation. In another class, I instantiate the sub-class (not AVAudioPlayer) and import the header.
When I attempt to call myMethod, I get the error:
[AVAudioPlayer myMethod]: unrecognized selector sent to instance
I'm certain I crea开发者_StackOverflow社区ted an AudioPlayer class, not AVAudioPlayer, so what gives?
:) easy to check the type of the object soon after its created. looks like the [audioplayer class] trick worked
精彩评论