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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:45:35+00:00 2026-06-14T04:45:35+00:00

This is making me a little crazy. I’m trying to register some NSUserDefaults in

  • 0

This is making me a little crazy. I’m trying to register some NSUserDefaults in my MonoTouch app.

var defaultsToRegister = new NSMutableDictionary();
defaultsToRegister.SetValueForKey(true, IS_REMINDING);
NSUserDefaults.StandardUserDefaults.RegisterDefaults(defaultsToRegister);

Obviously this isn’t compiling because a bool cannot be converted to NSObject. But when I want to set or retrieve a boolean value from NSUserDefaults I can use:

public bool IsReminding {
    get {
        return NSUserDefaults.StandardUserDefaults.BoolForKey(IS_REMINDING);
    }

    set {
        NSUserDefaults.StandardUserDefaults.SetBool(value, IS_REMINDING);
    }
}

In the settings plist file the boolean is written as <key>ReminderTimeOfDay</key><true/> which is what I would expect. So how to register a default boolean value?

  • 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-14T04:45:36+00:00Added an answer on June 14, 2026 at 4:45 am

    That’s how I do it:

    using (var defaults = NSDictionary.FromObjectsAndKeys (new object[] {
            true,
        }, new object [] {
            "AllowInternetAccess",
        })) {
    
        settings.RegisterDefaults (defaults);
    }
    

    Of course I have more than one key/value pair and this allows me to avoid several calls to a NSMutableDictionary.

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

Sidebar

Related Questions

This title may sound a little bit crazy, but this is what is making
This little piece of code is making me crazy: #include <stdio.h> int main() {
I'm very new to bash scripting and I'm trying to practice by making this
I'm making a little app with Flash Pro CS6 and I made this ball
I am just doing a little work this morning making some static libraries. Why
I'm making this little program because I was bored and I ran across this
I'm making this little project with fwrite (long story, and I can't use DB's).
I'm having trouble with the way I designed this little report I'm making. Is
I'm making this game where I'm trying to pair people. So I have this
We're making this web app in PHP and when working in the reports we

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.