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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:01:50+00:00 2026-06-07T00:01:50+00:00

I have a webservice and ios application. I use ASIHTTPRequest.h, ASIFormDataRequest.h headers to handle

  • 0

I have a webservice and ios application. I use ASIHTTPRequest.h, ASIFormDataRequest.h headers to handle connection to my php scripts/mysql database

In one of the viewcontrollers I need to send multiple request to my web service and handle each response, and viewcontroller’s view and methods are needed to refresh after each request.

ASIHTTPRequest has only one (void)requestFinished:(ASIHTTPRequest *)request event so I need to handle my responses in blocks inside of (void)requestFinished:(ASIHTTPRequest *)request to handle the request I come up with idea that maybe I can use a string and when request finishes i can use this string in if statement I wrote following code , but my condition in my requestfinish method if ([checkRequest rangeOfString:@"like"].location != NSNotFound) doesnt work

VoteMe.h

@interface VoteMe : UIViewController<UITextFieldDelegate>{
 NSMutableString  *checkRequest;
}
@property (retain, nonatomic) NSMutableString  *checkRequest;

Vote.m

@synthesize checkRequest;
- (void)viewDidLoad
{
 [self showPicture];
}

-(void)showPicture
 {
     checkRequest =[NSMutableString stringWithString:@"showPicture"];

     //request a random picture url, from server
     NSURL *url = [NSURL URLWithString:showpicture];
     ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

     [request setDelegate:self];
     [request startAsynchronous];
} 
-(IBAction)voteLike:(id)sender{

    checkRequest =[NSMutableString stringWithString:@"like"];

    NSURL *url = [NSURL URLWithString:voteup];
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

    [request setDelegate:self];
    [request startAsynchronous];

    [self showPicture];

}
- (void)requestFinished:(ASIHTTPRequest *)request
{    

    if ([checkRequest rangeOfString:@"like"].location != NSNotFound) {
     //do smth
     }

    if ([checkRequest rangeOfString:@"showPicture"].location != NSNotFound) {
    //do someth else
    }
}

The problem of above code when -(IBAction)voteLike:(id)sender is called it supposed to change string of checkRequest to “like” so when response of ASIFormDataRequest arrives if condition can work properly

In break points I see that checkRequest Variable is not a CFString

When I Use Nsstring instead of NSMutableString it is the same result

I know I need retain String then release afterwards but I Dont use alloc should I still need to retain/release

How can I achive my goal? Either a with better solution for checking if statement or fixing NSString and NSmutableString Issue above ?

  • 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-07T00:01:51+00:00Added an answer on June 7, 2026 at 12:01 am

    When you define something as a property (checkRequest), use self.checkRequest when you refer to it in code unless you have a very good reason not to. Those attributes you put on the property statement get ignored if you access the variable directly.

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

Sidebar

Related Questions

I have a webservice (.NET) which returns JSON result. The iOS application consumes that
I have made one application for consuming web service using SOAP protocol on iOS
I have an iOS app sending requests to a PHP based web service ,
I have a webservice using Hibernate as DAL - using MySql with InnoDB. Since
I have a WebService that when I use the instance of this webservice, occurs
I am going to make an application (iOS and Android) that will use a
I'm developing an iOS 4 application with latest SDK and XCode 4.2. I use
One of my client has backend server without any webservices but my iOS application
I am creating an iOS application that I need to connect to a database
I need some help for iphone application,i have some question regarding the new iOS

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.