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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:58:59+00:00 2026-05-14T06:58:59+00:00

The idea it’s very easy, i have an http download class, this class must

  • 0

The idea it’s very easy, i have an http download class, this class must support the http authentication but it’s basically a background thread so i would like to avoid to prompt directly to the screen, i would like to use a delegate method to require from outside of the class, like a viewController.

But i don’t know if is possible or if i have to use a different syntax.

This class use this delegate protocol:

//Updater.h
@protocol Updater <NSObject>
-(NSDictionary *)authRequired;
@optional
-(void)statusUpdate:(NSString *)newStatus;
-(void)downloadProgress:(int)percentage;
@end



@interface Updater : NSThread {
...
}

This is the call to the delegate method:

//Updater.m
// This check always fails :(
if ([self.delegate respondsToSelector:@selector(authRequired:)]) { 
    auth = [delegate authRequired];
}

This is the implementation of the delegate method

//rootViewController.m
-(NSDictionary *)authRequired;
{
    // TODO: some kind of popup or modal view
    NSMutableDictionary *ret=[[NSMutableDictionary alloc] init]; 
    [ret setObject:@"utente" forKey:@"user"];
    [ret setObject:@"password" forKey:@"pass"];
    return ret;
}
  • 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-14T06:58:59+00:00Added an answer on May 14, 2026 at 6:58 am
    if ([self.delegate respondsToSelector:@selector(authRequired:)]) { 
    

    In ObjC, the colons (:) in the method name is significant. That means authRequired and authRequired: are different methods. Try this instead:

    if ([delegate respondsToSelector:@selector(authRequired)]) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
The idea is to create a class that exposes a context but handles the
Any idea why this works: [[[[[self tabBarController] tabBar] items] objectAtIndex:2] setBadgeValue:@Hello]; But this doesn't?
Idea: I want to make smth like real time electronic blackboard. Many users have
My idea was to develop a traffic alert system on the android platform. Basically,
Bad idea mixing HTML and PHP? I was reading this tutorial and it seems
Basic idea of my if else statements is this: If .wrap is parent element:
Any idea how apache http client handles Retry-After header ? Apache has given default
No idea why this error is popping up. Here are the models I created
Any idea why the following mocking code does not work? org.hibernate.SessionFactory sessionFactory = Mockito.mock(SessionFactory.class);

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.