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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:10:42+00:00 2026-05-29T16:10:42+00:00

I need to get the users sex when my application starts up. How do

  • 0

I need to get the users sex when my application starts up.

How do I call the code only when the application first starts up? I just want to display an alert view with a simple “Are you Male or Female?” and then store the selection for use throughout the rest of the application. I don’t want the user to be asked every time they open the app, just the first time they open it.

Thanks,

Jack

EDIT

I know how to actually store the data, but where do I call the code so the alert view is only displayed when the application loads up?

  • 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-29T16:10:43+00:00Added an answer on May 29, 2026 at 4:10 pm

    Edit

    You could place this so that is get’s called in

    application:didFinishLaunchingWithOptions:
    

    Sounds like a good use for NSUserDefaults. It depends how you want to store that information for example if I was to use a string (I’ve chosen string as detecting whether no value is already set is easier than using int) I could have something like this on start up

    NSString * const PSUserSexKey = @"PSUserSexKey";
    
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    
    // If this returns nil then no value has been set yet
    if (![userDefaults stringForKey:PSUserSexKey]) {
        //.. present dialog for picking sex
    }
    

    Then when a user has selected their sex you can save it with something like:

    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    
    [userDefaults setObject:sex forKey:PSUserSexKey];
    [userDefaults synchronize];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just need get some vals located in application.ini(main ini) in the Controller plugin I
I am developing application where i need to get users phone number. Now i
I need to get the users Loging name from NTLM . Any one who
i have a problem with sql query. I need to get list of users.
I am porting a Windows application to OSX and need to get user's home,
I am using forms authentication and need to get a list of users that
System Specs: Infopath 2007 with c# code-behind Webservices Active Directory I need to get
I have a table with lon/lat coordinates What I need is to get users
Something like: get '/1.0/users/:id' puts current_route_matcher.to_s # '/1.0/users/:id' end Need to get it to
I need to get some admin users using google apps gmail the ability to

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.