Hello everybody,
I'm having a difficult time trying to figure out why cocoa gives me a warning
when trying to implement a delegate method in my class.
I'm writing the SpeakLine application from Aaron Hillegass' book in which the
user enters a line of text and there's 2 buttons: "Stop" and "Speak".
When the user presses Speak, the speak button should go not enabled and Stop go
enable, and when the SpeechSynthesizer finishes the opposite should happen.
Anyway, I set the delegate as self in the init method, like so:
-(id) init {
[super init];
speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
[speechSynth setDelegate:self];
return self;
}
and implement the method didFinishSpeaking like this:
-(void) speechSynthesizer:(NSSpeechSynthesizer *)sender
didFinishSpeaking:(BOOL)complete {
NSLog(@"Complete = %d", complete);
[startButton setEnabled:YES];
[stopButton setEnabled:NO];
}
I get the warning: "Class 'AppController' does not implement the
'SpeechSynthesizerDelegate' protocol" at the line [speechSynth
setDelegate:self];
Is there anything obviously wrong with what I'm doing? I followed the book
exactly and still get this warning.
Thanks in advance.
Martin.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]