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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:23:13+00:00 2026-06-12T20:23:13+00:00

I am developing am application in that,i have one requirement i.e when there is

  • 0

I am developing am application in that,i have one requirement i.e when there is incoming call corresponding method is called.I write alertview code,its works perfectly and shows alertview.

Alertview contains two button accept and reject ,when i click any of these buttons alertview delegate methods are not called.

+ (void)incomingCallAlertView:(NSString *)string
{
    UIAlertView *callAlertView=[[UIAlertView alloc] initWithTitle:string message:@""   delegate:self cancelButtonTitle:@"reject" otherButtonTitles:@"accept",nil];
    [callAlertView show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{

    NSLog(@"clickedButtonAtIndex");

    if(buttonIndex==0)
    {
          NSLog(@"buttonindex 0");
    }
    else
    {
          NSLog(@"buttonindex 1");
    }

}

I am calling the +(void)incomingcall method from another method using main thread.

- (void)showIncomingcalling
{
     [CallingViewController performSelectorOnMainThread:@selector(incomingCallAlertView:)      withObject:@"on_incoming_call" waitUntilDone:YES];
}

I write protocol in class ie <UIAlertViewDelegate> but the delegate methods are not called can any one solve my problem thanks in advance.

  • 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-12T20:23:15+00:00Added an answer on June 12, 2026 at 8:23 pm
    initWithTitle:string message:@"" delegate:self
                                               ^^
                                          Here it is!
    

    In the context of a class method, self refers to the class itself, and not an instance of an object (how would a class method know about instances of the class?). So you must either make the incomingCallAlertView: method into an instance method (i. e. prefix it with a minus sign instead of a plus sign and call self insetad of the class name in the showIncomingCalling method), or implement the delegate methods as if they were class methods:

    + (void)alertView:(UIAlertView *)av clickedButtonAtIndex:(NSInteger)index
    

    (This does work because the class object itself is an instance of its metaclass, and that means that class methods are really just instance methods of the metaclass.)

    etc.

    By the way, read attentively a decent Objective-C tutorial and/or language reference. This question should not have been asked here, as it’s too basic for not being looked up in other resources.

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

Sidebar

Related Questions

i am developing one application.In that i have 10 images .i want to move
I am developing a windows phone 7 application. I have requirement where there is
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
I'm developing a .NET application that will have both a WinForms and a Silverlight
I'm developing a simple Android application that would have an action bar on the
I am developing the application that uses DirectX for graphics rendering. I have to
I have a Rails application that accepts file uploads of CSV files. When developing
I have a typical enterprise/business application that I am developing that includes orders, salespersons,
I am developing an ASP.NET web application that incorporates google maps. I have an
I have been developing the application, and I need that drawingg is executed in

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.