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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:59:41+00:00 2026-06-13T05:59:41+00:00

I have a delegate, which recives a message to delete a item with that

  • 0

I have a delegate, which recives a message to delete a item with that item as an argument.
I want to show a confirmation AlertView, and then, if the users press Yes, i want to delete it.

So, what I have is

The delegate method that gets called:

- (void) deleteRecording:aRecording(Recording*)aRecording {

     NSLog(@"Cancel recording extended view");
     UIAlertView *alert = [[UIAlertView alloc]
                      initWithTitle: NSLocalizedString(@"Cancel recording",nil)
                      message: NSLocalizedString(@"Are you sure you want to cancel the recording?",nil)
                      delegate: self
                      cancelButtonTitle: NSLocalizedString(@"No",nil)
                      otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];
    [alert show];
    [alert release];

}

And the method thats checks which button has been pressed:

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

    switch (buttonIndex) {
        case 0:
        {
            NSLog(@"Delete was cancelled by the user");
        }
        break;

        case 1:
        {

            NSLog(@"Delete deleted by user");
        }


    }

}

So, my question is, how can i send the aRecording parameter from the first method to the second?

Thanks a lot

  • 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-13T05:59:42+00:00Added an answer on June 13, 2026 at 5:59 am
    1. Store that variable in a member variable (easiest solution)
    2. If you are only passing an int variable, you can set AlertView tag
      property.

       myAlertView.tag  = YOUR_INT;
      
    3. According to the documentation,

      Note : The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is
      private
      and must not be modified.

      So please use the 3rd method only if you are not intending to submit
      app to app store. Thanks user soemarko ridwan for the tip.

      For passing complex objects, subclass UIAlertView, add an object
      property

      @interface CustomAlertView : UIAlertView
      @property (nonatomic, retain) id object;
      @end
      
      @implementation CustomAlertView
      @synthesize object;
      - (void)dealloc {
          [object release];
          [super dealloc];
      }
      @end
      

      When you create AlertView

       CustomAlertView *alert = [[CustomAlertView alloc]
                        initWithTitle: NSLocalizedString(@"Cancel recording",nil)
                        message: NSLocalizedString(@"Are you sure you want to cancel the recording?",nil)
                        delegate: self
                        cancelButtonTitle: NSLocalizedString(@"No",nil)
                        otherButtonTitles: NSLocalizedString(@"Yes",nil), nil];
      [alert setObject:YOUR_OBJECT];
      [alert show];
      [alert release];
      

      In the delegate

      - (void)alertView:(TDAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
           NSLog(@"%@", [alertView object]);
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my main application delegate which contains a method that returns an object.
I have some read-only data that I want to initialise and then re-initialise periodically
If I have a delegate which resides within its own header file myDelegate.h. Then
I have a Silverlight delegate which gets an ObservableCollection in the EventArgs Result. The
I have the following delegate method which is listening for when text changes in
Can we have same delegate for two events ? which have same number of
I have a code in C# which uses lambda expressions for delegate passing to
I have the code below which I use clone() and delegate() . The code
I have a jQuery delegate which calculates the sum of textboxes when the user
I want to use a delegate which allows me to seach for a match

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.