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

  • Home
  • SEARCH
  • 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 6019455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:25:27+00:00 2026-05-23T03:25:27+00:00

I have been following a tutorial on creating an iPhone app with multiple xibs.

  • 0

I have been following a tutorial on creating an iPhone app with multiple xibs. The tutorial describes putting all the code in the View file, rather than the View Controller.

I am now looking at using NSDefaults to save a setting from my app’s options screen, and then display it again when the user goes back into the options screen. The problem is though, the setting is not getting loaded back in.

In my appdelegate.h file i have got:

NSInteger gMaxDistance;
@property (nonatomic) NSInteger gMaxDistance;

In my appdelegate.m file i have got:

@synthesize gMaxDistance;

In my OptionsView.m i have got:

NSUserDefaults *AppSettings = [NSUserDefaults standardUserDefaults];
[AppSettings setInteger:(int)distanceSlider.value forKey:@"MaxDistance"];
[AppSettings synchronize];

How do i correctly recall this value and where does the code need to go?

If i put it in the OptionsViewController.m viewDidLoad method, the compiler complains that it can’t find distanceSlider.

If i put it in the OptionsView.m file (where all my objects are found) in the initWithFrame method, nothing happens.

Please help, this has tied me in knots all day!!!

  • 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-23T03:25:28+00:00Added an answer on May 23, 2026 at 3:25 am

    You can get is by doing

    NSUserDefaults *appSettings = [NSUserDefaults standardUserDefaults];
    int recalledDistance = [appSettings integerForKey@"MaxDistance"];
    

    And you can do it from any viewController.

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

Sidebar

Related Questions

I have been following a tutorial to make Android App Widgets, and I was
I'm creating an Internet Explorer plugin using C#. I've been following a tutorial where
I have been following this tutorial. I'm having conceptual trouble at the point where
I'm using the Rails 3 plugin Will_Paginate and have been using the following tutorial
I am absolutely totally news to Rails and to MongoDB. I have been following
I've searched everywhere but I can't seem to find a solution. I have been
I am following Apples Core Data Tutoriol but implementing it into my own Project,
I am evaluating some web application frameworks out there, and finally, two of the
UPDATE: I decided to just download the demo off the website and build the
I am making a function that takes in a list of drivers and passengers

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.