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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:25:01+00:00 2026-06-15T13:25:01+00:00

We developed the iphone app which will be used by employees of the diff.

  • 0

We developed the iphone app which will be used by employees of the diff. organizations (actually we have not made it enterprise app , instead we are going to put this app on app store for the charge) , So whats we want is whenever the person will install the app, and the app will open first time , one pop up will come over there asking for the enter URL (which will be the URL points to the server of that persons organization) , So going through code logic , what i want is when we will come to the login page in the view did load i want to check whether the URL is already stored in the app or not, if its not stored then i will give that pop up asking for enter URL, and if its stored then simply i will allow him to enter the login details.

My problem is how should i store that URL and where should i store that URL and How should i check whether that is already stored or not. I tried to store that URL with… Where the urlfield.text is the URL i am going to store.

NSError *error;
    // For error information

    // Create file manager
    fileMgr = [NSFileManager defaultManager];

    // Point to Document directory
    documentsDirectory = [NSHomeDirectory() 
                          stringByAppendingPathComponent:@"Documents"];
    fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath];
    // File we want to create in the documents directory 
    // Result is: /Documents/file1.txt
    filePath = [documentsDirectory 
                stringByAppendingPathComponent:@"file1.txt"];
    str=urlField.text;
    // Write the file
    [str writeToFile:filePath atomically:YES 
            encoding:NSUTF8StringEncoding error:&error];

    // Show contents of Documents directory
    NSLog(@"Documents directory: %@",
          [fileMgr contentsOfDirectoryAtPath:documentsDirectory error:&error]);

and i am checking whether its there or not using..

 // fileExists is a BOOL variable
          fileExists = [[NSFileManager defaultManager] fileExistsAtPath:filePath]; 
         NSLog(@"Boolean value:=%d",fileExists);
        if ( fileExists  == 0 ) 
        {
           .......
          ........
        }

but each time i runs the app it returns the ‘0’ (means the BOOL variable fileExists) .
please some one will tell me the way to accomplish my task, I am end up with trying all the sides with this logic.

  • 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-15T13:25:02+00:00Added an answer on June 15, 2026 at 1:25 pm

    i use the NSUserDefaults for this.

    first upon for checking that whether the user is opening the app first time i check the value for the first object of NSUserDefault like

     //defaults is a object of NSUserDefault 
    NSString *URLEntered =[defaults objectForKey:@"URLISENTERED"];
    if (!URLEntered)  {
    
            [defaults setValue:@"0" forKey:@"URLISENTERED"];
        }
    

    the URLEntered returns null at first time, so i set the value 0 for Key URLISENTERED

    and i allowed users to enter the URL of there organizations server,
    within that i set the valu for key URLISENTERED as a 1 , like

    [defaults setValue:@"1" forKey:@"URLISENTERED"];
    

    and at the same time i take one more object of NSUserDefault to store the URL of the server and stored that like

    // defaultURL is the object of NSUserDefault, and main URL is the URL of server user entered
    
    [defaultURL setValue:mainURL forKey:@"mainURL"];
    

    so next when the user again logins to the app the value of

    [defaults objectForKey:@"URLISENTERED"]
    

    is 1 as we set and that time i navigated user to login screen directly , and have fetched the value of mainURL using

    mainURL=[defaultURL objectForKey:@"mainURL"];
    

    and used this URL for further use.

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

Sidebar

Related Questions

I have developed iPhone app which contains a 80MB audio files and 20MB images
I am resident of India and have developed an iPhone App which is mainly
I have existing iphone app which is developed using XCode 4.2 and base sdk
12 months ago I developed an iPhone app which was rejected by the app
I want to develop web service app which will be used by mobile app
I have developed an iPhone application which should support iOS4 and iOS5 based iPhone/iPad.
I am planning to develop an iphone app which makes use of image filters
I've developed an iPhone app that has been running MPMoviePlayer (pre 3.2 SDK) with
Possible Duplicate: Create provisioning profile in iphone application i developed my iphone app and
I was wondering if the Twitter app for iPhone developed by Twitter consumes from

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.