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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:49:04+00:00 2026-05-25T01:49:04+00:00

I would like to create an nsobject that will have all of my methods

  • 0

I would like to create an nsobject that will have all of my methods that will be used for talking to my php scripts and getting data from my database.

I would like to use ASIHTTPRequest wrapper to do this for me, however I am not sure how to structure this nsobject as there will be several methods calling different php scripts (or the same php with different functions in that).

Where I get abit lost is when thinking about calling an nsobject method from the view where I would like to display the data from the database as I am not sure how to get the data over to the view with the – (void)requestFinished:(ASIHTTPRequest *)request{ method.

For instance would the nsobject be like this

//...
-(IBAction) method1
{
     NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
     ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
     [request setDelegate:self];
     [request startAsynchronous];
}

-(IBAction) method2
{
     NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
     ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
     [request setDelegate:self];
     [request startAsynchronous];
}
-(IBAction) method3
{
     NSURL *url = [NSURL URLWithString:@"http://allseeing-i.com"];
     ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
     [request setDelegate:self];
     [request startAsynchronous];
}

//Then catch each method request with one

- (void)requestFinished:(ASIHTTPRequest *)request{ //etc

//and use one failed request 

- (void)requestFailed:(ASIHTTPRequest *)request{ //etc

or do you put the requestFinished method inside the view you want to display the information in?

  • 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-25T01:49:05+00:00Added an answer on May 25, 2026 at 1:49 am

    You should probably be putting the HTTP request callbacks (requestFinished: and requestFailed:) in a subclass of UIViewController. Whatever view controller is controlling the relevant view, most likely, unless there is a strong need to share the functionality between view controllers, in which case you may factor it into a singleton whose only job is handling these network requests. Either way, the views that need this data should be modified by their view controllers. The view itself shouldn’t have any contact with network code.

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

Sidebar

Related Questions

I would like create a custom DataRow that will have -let's say- a propery
I would like create URL rewrite rule that will set default document for my
i would like create a array of structure which have a dynamic array :
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a class that runs something (a runnable) at regular
I would like to create a hierarchy of exceptions. I used the C++ idiom
I would like create an inner shadow on my UIView on iPad like that
I have an Objective-C class that looks something like: @interface myClass : NSObject {
I have a class like this: @interface MyCollection : NSObject { NSMutableDictionary *data; }
I would like to create this shape using just css. I am pretty sure

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.