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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:11:02+00:00 2026-06-09T01:11:02+00:00

I’m making a search function in my app but I’m having some trouble figuring

  • 0

I’m making a search function in my app but I’m having some trouble figuring the codes for my UISlider. Slider is created in the storyboard and hooked up. I have a .plist with an array of dictionaries as info source. The dictionaries are containing info about wines.


  • Slider should reprecent the values of the key “Price” in the dictionaries. I chose Number for it, so some of them are like 78,900000000001. In other words they need format with two decimals.

  • minimumValue = the lowest value in the dictionaries, rounded down to closest 10 (if lowest value = 67,90 then minimumValue = 60) if that’s not too complicated.

  • maximumValue = highest value but rounded up to closest 10.

  • It is for user to set an optional minimum price, so default position should be minimumValue.

  • I want it to step by 5 numbers at the time when slided, like 70, 75, 80, 85, 90 etc


This is the codes for the UISlider so far:

- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = @"Search";

NSString *path = [[NSBundle mainBundle] pathForResource:@"Wines" ofType:@"plist"];
allObjectsArray = [[NSMutableArray alloc] initWithContentsOfFile:path];

minSlider.continuous = YES;
[minSlider setMinimumValue: ]; // Lowest value rounded down to closest 10
[minSlider setMaximumValue: ]; // Highest value rounded up to closest 10

[minSlider addTarget:self
           action:@selector(minValueChanged:) 
 forControlEvents:UIControlEventValueChanged];

minText.text = minSlider.minimumValue // <--- or something like that
}

- (void)minValueChanged:(UISlider*)sender
{
 // And something here for change of value and text field
minText.text = current slider value
}

Can you help me finish this? I’ve started up based on what I learned from my research before asking. 🙂

  • 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-09T01:11:04+00:00Added an answer on June 9, 2026 at 1:11 am

    It depends a bit on how your plist is structured, but you are not telling us… I am assuming it looks something like

    <array>
      <dict>
        <key>name</key>
        <string>Bordeaux</string>
        <key>price</key>
        <real>75.40</real>
      </dict>
      <dict>
        <key>name</key>
        <string>Chardonnay</string>
        <key>price</key>
        <real>29.90</real>
      </dict>
    </array>
    

    This is how you determine the minimum and maximum values:

    NSNumber *minValue = [allObjectsArray valueForKeyPath:@"@min.price"];
    NSNumber *maxValue = [allObjectsArray valueForKeyPath:@"@max.price"];
    

    This is how you round the numbers:

    float roundedDown = ((int)[minValue floatValue]/10)*10.0;
    float roundedUp = ((int)[maxValue floatValue]/10)*10.0 +10;
    

    This is how you set the slider minimum value:

    minSlider.minimumValue = [minValue floatValue];
    

    This is how you make a label display only multiples of 5:

    -(void)minValueChanged:(UISlider*)sender {
        minText.text = [NSString stringWithFormat:@"%.0f", 
           5.0 * ((int) (sender.value / 5) + 0.5)];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I want to construct a data frame in an Rcpp function, but when I
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.