Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6335039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:46:39+00:00 2026-05-24T18:46:39+00:00

I am trying to learn Objective C and have an error in the code

  • 0

I am trying to learn Objective C and have an error in the code for one of my lessions and I do not know how to solve it.
Code:

 //  AppController.m

 #import "AppController.h"

 @implementation AppController

 - (id)init
    {
         [super init];
         speechSynth = [[NSSpeechSynthesizer alloc] initWithVoice:nil];
         [speechSynth setDelegate:self];
         voiceList = [[NSSpeechSynthesizer availableVoices] retain];
         Return self;
    }

From [speechSynth setDelegate:self]; I get the error: Sending ‘AppController *’ to parameter of incompatible type ‘id< NSSpeechSynthesizerDelagate>’.
The program compiles with a caution flag and seems to run correctly. I have compared my code with the author’s code and can find no differences and none of my searches have indicated I should get an error on this line. The book was written for Xcode 3 and I am using Xcode 4.0.2.

Any suggestions or pointing me in the right direction would be greatly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:46:40+00:00Added an answer on May 24, 2026 at 6:46 pm

    Xcode is warning you that the setDelegate method expects an instance of a class that has implemented the NSSpeechSynthesizerDelagate protocol. Now, you have, but you’ve probably just forgotten to declare that you have. In your class declaration, change

    @class AppController : NSObject
    

    to

    @class AppController : NSObject<NSSpeechSynthesizerDelegate>
    

    to tell the world “I obey NSSpeechSynthesizerDelegate!”, and silence the warning. You never know – you might get warned that you’ve forgotten to implement some non-optional delegate methods, and save yourself an annoying bug somewhere down the line. 

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to learn Objective-C. I almost finished one excercise but it is not
I'm trying to learn objective C and one of the things i find very
I'm trying to learn objective-c, and have a question regarding this method: - (UITableViewCell
I am trying to learn Objective-C and have run into a problem with pushing
I'm trying to learn Objective-C for xcode. I was wondering if there was an
Trying to learn about php's arrays today. I have a set of arrays like
Trying to learn MVP pattern with C#... Does anyone know of any particularly good
In trying to learn how to create objects in ActionScript, I have had no
While trying to learn Unity , I keep seeing the following code for overriding
I'm trying to learn about shift-reduce parsing. Suppose we have the following grammar, using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.