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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:14:58+00:00 2026-06-05T07:14:58+00:00

im actual trying to save the usersettings inside a plist so that i can

  • 0

im actual trying to save the usersettings inside a plist so that i can access them from everywhere. But when saving the UISlider value to my Array i always geht the message

Sending ‘float’ to parameter of incompatible type ‘id’;

the Array looks like this:

NSArray *value = [[NSArray alloc] initWithObjects: [theGradeSlider value], [theBackgroundSound isOn], [theButtonSound isOn], nil];

i also tried with MSMutableArray but this doesn’t work too….


ANOTHER SOLUTION

i tried it know with NSUserDefaults and it worked.

to save the Settings (should be inserted in viewDidUnload or viewDidDiassappear):

NSUserDefaults *settings = [[NSUserDefaults alloc] initWithUser:@"User"];

[settings setFloat:theGradeSlider.value forKey:@"theGradeSlider"];
[settings setBool:theBackgroundSound.on forKey:@"theBackgroundSound"];
[settings setBool:theButtonSound.on forKey:@"theButtonSound"];
[settings synchronize];

to load the Settings (should be inserted in viewDidLoad or ViewDidAppear):

NSUserDefaults *settings = [[NSUserDefaults alloc] initWithUser:@"User"];

theGradeSlider.value = [settings floatForKey:@"theGradeSlider"];
theBackgroundSound.on = [settings boolForKey:@"theBackgroundSound"];
theButtonSound.on = [settings boolForKey:@"theButtonSound"];
  • 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-05T07:14:59+00:00Added an answer on June 5, 2026 at 7:14 am

    The problem here is that the values you are putting into the array are not objects. In order to do this (although I would suggest a dictionary as opposed to an array), you would want to create NSNumber objects for each.

    NSNumber *sliderValueObj = [NSNumber numberWithFloat: [theGradeSlader value]];
    NSNumber *backgroundSoundObj = [NSNumber numberWithBool: [theBackgroundSound isOn]];
    NSNumber *buttonSoundObj = [NSNumber numberWithBool: [theButtonSound isOn]];
    
    NSArray *value = [[NSArray alloc] initWithObjects: sliderValueObj,backgroundSoundObj,buttonSoundObj, nil];
    

    or

    NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys: sliderValueObj, @"slider",
                          backgroundSoundObj, @"backgroundSound",
                          buttonSoundObj, @"buttonSound",
                          nil];
    

    For better form, use contents for the keys.

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

Sidebar

Related Questions

I'm trying to get an image from an URL but when I save it
I'm trying to hide actual sub-directory from url path using mod_rewrite. The folder actual
I am trying to reset the actual value attribute of an input so that
I'm trying to switch from CellTable to DataGrid. The actual change was very easy
I'm trying to implement a jQuery slider with increments. I've gone from, the actual
I have two arrays of data that I'm trying to amalgamate. One contains actual
I know in an actual query, you can use auto_increment=1 but how is this
I've been trying to use AutoMapper to save some time going from my DTOs
I am trying to access the XML http://webservices.ns.nl/ns-api-stations using ASIHTTPRequest. But what I am
I'm trying to save contents of an NSView as an image, but, only the

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.