Using self.speechSynth instead of _speechSynth


#1

Why do I get an error when use self.speechSynth instead of _speechSynth, aren’t they the same thing?

        self.speechSynth = [[NSSpeechSynthesizer alloc]initWithVoice:nil];

instead of

 _speechSynth = [[NSSpeechSynthesizer alloc]initWithVoice:nil];

in this init

- (id)init
{
    self = [super init];
    if (self) {
        NSLog(@"init");
        
/*        instance of NSSpeechSynthesizer 
         with a default voice */
        _speechSynth = [[NSSpeechSynthesizer alloc]initWithVoice:nil];

    }
    return self;
}

#2

Do you have a property named speechSynth?
Can you post the code for the property declaration and definition?


#3
@interface SpeakLineAppDelegate : NSObject <NSApplicationDelegate, NSSpeechSynthesizerDelegate>
{
    NSArray *_voices;
    NSSpeechSynthesizer *_speechSynth;
    
}

_speechSynth is instant variable in header file