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

  • SEARCH
  • Home
  • 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 8239337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:06:47+00:00 2026-06-07T20:06:47+00:00

Being a beginner I am finding it very hard to understand delegates, so I’ll

  • 0

Being a beginner I am finding it very hard to understand delegates, so I’ll try to ask my question as good as I can:

I want Connection.m to be the delegate of Controller.h.
In my Controller.h I have

@protocol HeliControllerDelegate <NSObject>

@optional
- (void) measurementUpdated:(NSNumber *) measurement;
- (void) didDiscoverCharacteristic; // neh

@end

@interface HeliController : UIViewController <CBPeripheralDelegate>
@property (nonatomic, assign) id<HeliControllerDelegate> delegate;
@end

and synthesize in Controller.m :

@synthesize delegate = _delegate;

before the interface decleration. In Controller.m I invoke didDiscoverCharacteristic with

- (void) peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error{

NSLog(@"Did discover characteristic for service %@", [service.peripheral UUID]);

for(CBCharacteristic *c in [service characteristics]){

    if([[c UUID] isEqual:HeliController.throttleCharacteristicUUID]){

        NSLog(@"Found throttle characteristic");

        self.throttleCharacteristic = c;

        [self.delegate didDiscoverCharacteristic];

    }
}
}

In the delegate file Connection.h I start with

@interface Connection : UIViewController <CBCentralManagerDelegate, ControllerDelegate> {
}

so that I can use the methods from Controller.h’s protocol, but even thoug the program executed the didDiscoverCharacteristic call nothing happens on the method implementation in Connection.m.

All help on this is really appreciated.

  • 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-06-07T20:06:48+00:00Added an answer on June 7, 2026 at 8:06 pm

    Did you declare delegate in Controoler.h file?

    @interface Controller 
    {
        id (ControllerDelegate) controllerDelegate;
    }
    @property (nonatomic, assign) id (ControllerDelegate) controllerDelegate;
    

    use <> brackets instead of () for ControllerDelegate
    and add below in .m file

     @synthesize controllerDelegate 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry in advance for this being such a beginner question. Here are the steps
Being spotted in context of this question this seemingly inconsistent behavior can be reproduced
being a beginner i m trying to develop a very simple service using express
Being a beginner I am having difficulty to understand the following statement a)If in
I have came across the following code, and being a C beginner, I came
Being new to c#, I don't understand how variables are passed between objects. My
This is a beginner question with regard to using the SecureSocial(version 0.2.3 module with
hello i'm a beginner java developer and this is one question in a list
I'm a beginner learning Windows Forms Applications in C# and I want to write
Please forgive me for being a complete beginner: I am trying to log into

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.