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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:17:12+00:00 2026-05-29T07:17:12+00:00

the answer for this question is probably simple but currently I’m stumped and any

  • 0

the answer for this question is probably simple but currently I’m stumped and any help would be welcomed.

I have attached a contextual menu to a table view. One of the menu options is to delete the element in the tableview. I’m using a NSAlert to pop a modal window to confirm deletion. I’d like to pass along a value from the tableview to the alert selector so I have some reference to use for the delete.
here is the alert string:

    [alert beginSheetModalForWindow:_window
        modalDelegate:self
        didEndSelector:@selector(deleteAlert:code:context:)
        contextInfo:s]; 

any time I try to pass an object as the contextInfo I get a warning. If I try to pass NSInteger row (row from tableview) I get this compiler warning: warning: Semantic Issue: Incompatible integer to pointer conversion sending ‘NSInteger’ (aka ‘long’) to parameter of type ‘void *’
If I try to pass a string in variable name form I get this: error: Automatic Reference Counting Issue: Implicit conversion of an Objective-C pointer to ‘void *’ is disallowed with ARC. I also tried a dictionary without any luck.

However if I pass a string like this: contextInfo:@”some info”,I don’t get any errors and I can actually see it in the selector. which of course is kinda useless for my needs.

So, how do I pass the table row information into the alert so I can use it in the delete selector?

  • 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-29T07:17:14+00:00Added an answer on May 29, 2026 at 7:17 am

    If you want to pass the row index, you can wrap it in an NSNumber instance:

    [alert beginSheetModalForWindow:_window modalDelegate:self didEndSelector:@selector(deleteAlert:code:context:) contextInfo:(__bridge void *)[NSNumber numberWithInteger:row]];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is probably a simple answer to this question but I do not have
This is probably a really dumb question with a simple answer but... I am
This is probably a really simple jQuery question, but I couldn't answer it after
I feel like the answer to this question is probably very simple, but I'm
There is probably a very simple answer to this question, but I can't for
All, This question probably has a very simple answer - something I'm overlooking. But
there is probably a very simple answer to this very simple question, but i
Well this is probably a stupid question with a simple answer but when using
all. This question probably has a devilishly simple answer but it has kept me
Simple question (probably), but I'm buggered if I can find an answer... I have

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.