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 7635439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:25:34+00:00 2026-05-31T07:25:34+00:00

Another case of protocol method not being called – NO idea what am I

  • 0

Another case of protocol method not being called – NO idea what am I doing wrong here…

Here is the code, omitting unnecessary info…

first header file: AccessNumber.h

@protocol AddItemDelegate <NSObject>
@required
- (void) processSuccessful: (BOOL)success;
@end

@interface AccessNumber : UIViewController <UITableViewDelegate, UITableViewDataSource, ABPeoplePickerNavigationControllerDelegate, UIAlertViewDelegate> {

id <AddItemDelegate> delegate;

}
@property (retain) id <AddItemDelegate> delegate;
@end

first .m file: AccessNumber.m – I am calling the protocol method from viewdidload just for testing purposes, it should basically get called from another method, but same thing for the sake of this convo (tried both of course)

#import "AccessNumber.h"
#import "History.h"

@synthesize delegate;

- (void)viewDidLoad
{
         [super viewDidLoad];

....

     [[self delegate] processSuccessful:YES];
}

second file header: History.h

@interface History : UIViewController <UITableViewDelegate, UITableViewDataSource, AddItemDelegate> {
 ....
    }

method implementation in history.m

- (void) processSuccessful: (BOOL)success {

NSLog(@"SUCCESS");
}

Appreciate any help. 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-31T07:25:35+00:00Added an answer on May 31, 2026 at 7:25 am

    The code seems a little bit funny but you are not telling your “AccessNumber” class who is his delegate, even though you are making the “History” class implement the protocol established by yourself (otherwise you would get a warning).

    You have to set the delegate for the “AccessNumber” class like this when setting it up from within “AccessNumber.m”:

    self.delegate = historyInstance;
    

    or like this when setting it up from within “History.m”:

    accessNumberInstance.delegate = self;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string read from another source such as \b\bfoo\bx. In this case,
I am using protocol buffer in .net http://code.google.com/p/protobuf-net/ . I installed the visual studio
When doing a PUT or DELETE with an If-Match header, in case the ETag
Cliffnotes: I've gotten method chaining to work as I expected in one case, but
Another easy one hopefully. Let's say I have a collection like this: List<DateTime> allDates;
Another poster asked about preferred syntax for infinite loops . A follow-up question: Why
Another question asked about determining odd/evenness in C, and the idiomatic (x & 1)
another request sorry.. Right now I am reading the tokens in one by one
another issue in IE 6... link The navbar link list has a border applied
Another basic Rails question: I have a database table that needs to contain references

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.