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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:21:25+00:00 2026-05-22T20:21:25+00:00

I am trying to receive the user selection from a segmented control and then

  • 0

I am trying to receive the user selection from a segmented control and then save it to NSUserDefaults, i.e., if the first segment is selected then it saves the int “1” to NSUserDefaults, but if the second segment is selected then it saves the int “2” to NSUserDefaults.

  • 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-22T20:21:26+00:00Added an answer on May 22, 2026 at 8:21 pm

    The easiest way is to use a binding. Bind the selected index of the control to the shared user defaults controller, and set the model key path to the preference key you want to use.

    Edit to add: I see that you didn’t specify Mac or iOS. If it’s Mac, binding is definitely the easy way, whereas binding is not available on iOS.

    The fact that segmented control values start at 0 is unimportant. You could bind selected tag rather than selected index, and then use any tag values you want.

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

Sidebar

Related Questions

I am trying to receive user input and then put it into a list.
I am trying to write a simple activity that received from the user its
I am trying to receive a json object back from php after sending data
I am trying to receive an image from the Android Gallery via an ACTION_SEND
I'm trying to make my main window to receive notifications when user presses a
I am basically trying to return from a method which reads user input from
All, I am trying to create a table to receive user inputs (UGC). This
I'm trying to receive Facebook notifications (within Facebook) when a user Likes a post
for one of my applications, I am trying to send/receive commands/information from my GUI
I'm trying to create a list from arguments I receive in a url. e.g

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.