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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:59:55+00:00 2026-06-14T23:59:55+00:00

This is the valueChanged voids for my two UISliders. Their function is to set

  • 0

This is the valueChanged voids for my two UISliders. Their function is to set the minimum and maximum price for objects. What I cannot figure out it how to make them not exceed each others values.

So if minPrisSlider.value = 100, it should not be possible to drag the maxPrisSlider below 100 and opposite.

- (void)minValueChanged:(UISlider*)sender
{
NSUInteger index = (NSUInteger)(minPrisSlider.value + 0.5); // Round the number.
[minPrisSlider setValue:index animated:NO];

int progressAsInt =(int)(minPrisSlider.value + 0.5f);
NSString *newText =[[NSString alloc] initWithFormat:@"%d,-",progressAsInt];
minPrisText.text = newText;
}

- (void)maxValueChanged:(UISlider*)sender
{

NSUInteger index = (NSUInteger)(maxPrisSlider.value + 0.5); // Round the number.
[maxPrisSlider setValue:index animated:NO];

int progressAsInt =(int)(maxPrisSlider.value + 0.5f);
NSString *newText =[[NSString alloc] initWithFormat:@"%d,-",progressAsInt];
maxPrisText.text = newText;

}

I have tried adding

[minPrisSlider setMaximumValue:maxPrisSlider.value]; in maxValueChanged

and

[maxPrisSlider setMinimumValue:minPrisSlider.value]; in minValueChanged

but it returns strange results…

Got some working solution for this?

  • 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-14T23:59:56+00:00Added an answer on June 14, 2026 at 11:59 pm

    The thing is, the slider’s thumb position is proportional to its maximum/minimum value. So setting the maximum/minimum value shouldn’t do
    In your case, you should try this :

    if ([minPrisSlider value] > [maxPrisSlider value])
      [minPrisSlider setValue:[maxPrisSlider value]];
    

    And reverse it for the max slider. Don’t forget to set the continuous value :

    [minPrisSlider setContinuous:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Two different slider controls fires this function below, their names are seektomediaposition and seektomediaposition2.
When making a selection on this simple gui list I am getting valueChanged to
This works. $(document).ready(function(){ $(.items article).click(function(){ window.location=$(this).find(a).attr(href); return false; }); }); However , when the
this.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { // How do I access the
This is the code in the NumericUpDown ValueChanged event: private void numericUpDown1_ValueChanged(object sender, EventArgs
This listener works 95% of the time: messagesJList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt)
i have a problem with this script. Whenever i export this set of codes
gcc 4.6.2 c89 I am passing a pointer to a function. This pointer will
this is my first question in here, and I would like to ask if
This question is directly related to this SO question I posed about 15 minutes

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.