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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:09:50+00:00 2026-06-10T13:09:50+00:00

MainViewController contains UISegmentedControl with 3 segments. SliderSubViewController contains a UISlider and -(void) sliderValueChanged:(UISlider*)sender I

  • 0

MainViewController contains UISegmentedControl with 3 segments.

SliderSubViewController contains a UISlider and -(void) sliderValueChanged:(UISlider*)sender

I want to add a code like this in SliderSubViewController.m but I’m stuck on how to access the UISegmentedControl and add an image:

- (void)viewDidLoad
{
[super viewDidLoad];

mainController = [[MainViewController alloc] initWithNibName:nil bundle:nil];


[minPrisSlider addTarget:self
                  action:@selector(sliderValueChanged:) 
                  forControlEvents:UIControlEventValueChanged];


- (void)sliderValueChanged:(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;

if (minPrisSlider.value != 70) {
    /*mainController.segmentedControl add main bundle image named "CheckboxChecked.png" 
   to current segment*/
}
}
  • 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-10T13:09:51+00:00Added an answer on June 10, 2026 at 1:09 pm

    If you have added SliderViewController as subview on MainViewController, One approach you can try is to just declare object of MainViewController in SliderViewController write @property and @synthesize, dont allocate it and while adding SliderView as subview just assign it as

    sliderviewcontrollerObject.mainViewControllerObject = self;

    now you can access segmentedControl from sliderview ass self.mainViewControllerObject.segmentedbar

    Also you can try delegate approach.

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

Sidebar

Related Questions

In my MainViewController I am using this code: static NSBundle *bundle = nil; +(void)setLanguage:(NSString
Sorry if this is an easy one. Basically, here is my code: MainViewController.h :
I have a UITableView that loads content into a UIWebView like this: //MainViewController.m -
i am having a problem with my application,.i have this code in my mainviewcontroller
In current NSWindowController, add a child window (mainViewController.window),then close current window,BUT when the method
I have a MainViewController, and I want to add two UITableView's to it, each
I have this method in my MainViewController: -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { NSLog(@MAIN CONTAINER WILL ANIMATE);
I have a MainView with MainViewController. Now I want to add a specific area
I want to reload(refresh) my mainviewcontroller after changes. I add some data to data
I have the following piece of code in my MainViewController. Is that the best

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.