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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:54:18+00:00 2026-05-15T10:54:18+00:00

I have added a UISegmentedControl in my application. None of the buttons are selected

  • 0

I have added a UISegmentedControl in my application. None of the buttons are selected in normal state. I want to implement a button click event when the first segment is selected, and another event when another button is clicked.

  • 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-05-15T10:54:19+00:00Added an answer on May 15, 2026 at 10:54 am

    If I understand your question correctly, you simply have to implement a target-action method (supported by UIControl which is UISegmentedControl‘s parent class) for the constant UIControlEventValueChanged, exactly like in the example given in UISegmentControl’s reference documentation.

    i.e.

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

    used for a message with the following signature:

    - (void)action:(id)sender
    

    or

    [segmentedControl addTarget:self
                         action:@selector(action:forEvent:)
               forControlEvents:UIControlEventValueChanged];
    

    for

    - (void)action:(id)sender forEvent:(UIEvent *)event
    

    or

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

    for the simplest method:

    - (void)action
    

    which are standard types of target-action selectors used in UIKit.

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

Sidebar

Related Questions

I have added an observer on sales_order_place_before Event and want to customize grand total
I have added a few buttons to self.view. When the user clicks on one
I have added a LinearLayOut having some buttons My screen is RelativeLayOut it self
I have added the XFBML facebook like button. It shows fine in Chrome and
I have added some testers to my Facebook application while it is still in
I have added a bar button item in my tool bar and I implemented
I have added an action sheet in my app. My application is tab bar
I have added an event listener for a particular event, for e.g. CollectionEvent.COLLECTION_CHANGE. Inside
I have added a textbox to my WinMo app's form and I want to
I have added 8 radio buttons in my dialog layout in the resource manager,

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.