OMG, I'm sorry I just found that I should add <NSSpeechSynthesizerDelegate> 
next to the class definition. 
Disregard my last message.

(I wonder why he doesn't mention that in the book).


Begin forwarded message:

> From: Martin Beroiz <martinber...@gmail.com>
> Date: February 12, 2010 8:19:04 PM CST
> To: Cocoa Dev <cocoa-dev@lists.apple.com>
> Subject: warning when setting the delegate of SpeechSynthesizer 
> 
> 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 (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to