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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:03:54+00:00 2026-05-21T22:03:54+00:00

i am getting response like {nok} …. now i want to compare this for

  • 0

i am getting response like {“nok”} …. now i want to compare this for check status of data sent or not.
this is my code

   NSString *responseStr = [sender responseString];


 NSLog(@"response string %@", responseStr);
if([responseStr isEqualToString:@"nok"])
 {
    NSLog(@"Hiii");
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Attenzione: si è verificato un errore di richiesta del premio." delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
    [alert show];
    [alert release];
}
  else {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Inviato con successo" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
    [alert show];
    [alert release];
    [self startIscrivity2View];

       }

it’s always run else part…

please help me

  • 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-21T22:03:54+00:00Added an answer on May 21, 2026 at 10:03 pm

    USe the below function of NSString.

    - (NSRange)rangeOfString:(NSString *)aString
    

    The above function will not check for the equality, it will tell u whether your responseStr contain “nok” string OR not ..

        NSRange myStringRange = [responseStr rangeOfString:@"nok"] ;
        if(myStringRange.location != NSNotFound )
        {
          NSLog(@"Hiii");
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Attenzione: si è v      erificato un errore di richiesta del premio." delegate:self cancelButtonTitle:nil  otherButtonTitles:@"OK", nil];
        [alert show];
        [alert release];
         }
      else {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Inviato con successo" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
        [alert show];
        [alert release];
        [self startIscrivity2View];
    
           }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting json response like this {item_id:1,item_title:Item 1}{item_id:2,item_title:Item 2} how would I parse
i am getting the JSON response like this : [ {IndexID:1,IndexName:Consumer Confidence Index(CCI),IndexValue:34.79,Month:10,PercentageChanged:0,Position:0,Year:2011}, {IndexID:1,IndexName:Consumer
SO I am getting a response from the google translate API's like this: {\responseData\:
Hi I am getting a response from server which is something like this {total:110,responses:{13:26,14:24,15:40,16:20}}
i m doing json parsing and i getting response for data like date:1330387200 so
I'm getting Response from Webservices Date like 2012-08-17T00:00:00. I want to Display Date only
i wrote one method for getting details.in rest client getting response like this. <string
im getting response in json, but this wont parse the json response. what m
I am getting response from web service in xml format and data are inside
I am getting json response from this google api service to get reverse geo

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.