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 have been playing with the source code available from the following tutorial .
I have been following the ASP.Net Movie Database Tutorial , and it was all
I have been following the salesforce Recruiting App tutorial, and reached the section on
I'm a newcomer to Rails, and have been following the tutorial on the rails
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker
I have been following the following post on using multiple ItemTemplates in a ListView
Been following the Core Data tutorial on Apple's developer site , and all is
Have been following Rails Tutorial by Michael Hart rails version 3.0 on mac OS
I have been following this tutorial and everything was going nice and easy until

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.