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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:54:27+00:00 2026-05-15T03:54:27+00:00

I have a BSjax class that I wrote that lets me make async calls

  • 0

I have a “BSjax” class that I wrote that lets me make async calls to our server to get json result sets, etc using the ASIHTTPRequest class. I set it up so that the BSjax class parses my server’s json response, then passes control back to the calling view controller via this call:

[[self delegate] performSelectorOnMainThread:@selector(bsRequestFinished:) withObject:self waitUntilDone:YES];

… where “bsRequestFinished” is the callback method in the calling view controller. This all worked fine and well until I realized that some pages are going to need to make different types of requests… i.e. I’ll want to do different types of things in that callback function depending on which type of request was made.

To me it seems like being able to pass different callback function names to my BSjax class would be the cleanest fix… but I’m having trouble (and am not even sure if it’s possible) to pass in a variable that holds the callback function name and then replace the call above with something like this:

[[self delegate] performSelectorOnMainThread:@selector(self.variableCallbackFunctionName) withObject:self waitUntilDone:YES];

… where “self.variableCallbackFunctionName” is set by the calling view controller when it calls BSjax to make a new request.

Is this even possible? If so, advisable? If not, alternatives?

EDIT: Note that whatever fix I arrive at will need to take into account the reality that this class is making async requests… so I need to make sure that the callback function processing is correctly tied to the specific requests… as I can’t rely on FIFO processing sequence.

EDIT 2: Looking like passing in a SEL type variable is the way to go? What I’m fighting with now is figuring out the syntax for saving it as a retained property of the BSjax class.

  • 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-15T03:54:28+00:00Added an answer on May 15, 2026 at 3:54 am

    What type of variable is variBkecallbackfunctionname? An NSString? If it is, you’ll probably want something like this:

    [[self delegate] performSelectorOnMainThread:NSSelectorFromString(self.variableCallbackFunctionName) withObject:self waitUntilDone:YES];
    

    I am at an iPad so I can’t test this, but give it a try.

    Edit: and if variableCallbackFunctionName isn’t an nsstring, the easiest way might be to make it, if I understand your question.

    Edit 2: docs for that are at http://developer.apple.com/mac/library/iPad/index.html#documentation/cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html%23//apple_ref/c/func/NSSelectorFromString

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

Sidebar

Related Questions

Have a simple contact us XPage created. Have server side validation in place that
Have a digital media device that I'd like to get the ImageMagick command-line tool
have written this little class, which generates a UUID every time an object of
Have a bunch of WCF REST services hosted on Azure that access a SQL
have been trying couple of hours now to make my iphone app universal. The
Have a look at one of my websites: moskah.com The problem is that it
Have a network location that shows paths in the 8.3 short format. I need
Have data that has this kind of structure. Will be in ascending order by
Have data that has this kind of structure: $input = [ { animal: 'cat',
Have some dates in my local Oracle 11g database that are in this format:

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.