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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:02:32+00:00 2026-05-15T18:02:32+00:00

Hey all, this should be a simple task but for some reason i am

  • 0

Hey all, this should be a simple task but for some reason i am making it harder… I am trying to save some text from an XML file to a NSString. But when i debug it, the string says “Out of scope”.

Here is my code:

in my .h file:

 @interface RootViewController : UIViewController<MBProgressHUDDelegate> {
     NSString *thePW;   
 }

and my .m file:

 NSString *thePW;
 ...
 - (void)viewDidLoad {
 ...
    if(e == nil){
        NSString *response = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

        thePW = response; // <-- this is where it has "Out of scope"
        [response release];
    }
 }

 - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
 {
     if (buttonIndex != [alertView cancelButtonIndex])
     {
        if (thePW == @"0000")
        {
           NSLog(@"correct!");
        }
     }
 }
  • 1 1 Answer
  • 1 View
  • 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-15T18:02:34+00:00Added an answer on May 15, 2026 at 6:02 pm

    You may also try:

    thePW = [NSString stringWithFormat:@"%@",response];   // to assign the string value.
    

    and
    while comparing strings:

    (thePW isEqualToString @"0000")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all. I know this sounds simple, but I can't find a way to
Ok, this should be dirt simple. I'm trying to read charactes from a serial
Hey all, this should be pretty simple to answer: Is there a property of
Hey all, i have been trying for a few minutes on this problem and
Hey everyone, this seems like it should be a simple one; I really hope
Hey all, i am in need of some help trying to figure out why
Hey all - I've been googling this as much as possible, but nothing I
Hey all, I think this might be a bug, but it's killing me. I
Hey all -- this question is specifically about a gender validation, but I'm interested
Hey all, this is the code i have to check for a day thats

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.