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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:08:10+00:00 2026-06-15T20:08:10+00:00

I am making an IOS app which plays wav files on the press of

  • 0

I am making an IOS app which plays wav files on the press of a UIButton. I am attempting to implement a UISegmentedcontrol, in order to change which sample is being played when a different segment is highlighted.

Here is my code for my viewController.h:

@property (nonatomic, retain) IBOutlet UISegmentedControl *segmentedControl;
-(IBAction)playFile1;
-(IBAction)playFile2;
-(IBAction)playFile3;
@end

and viewController.m

@synthesize segmentedControl = segmentedControl;
-(IBAction)playFile1{
    if([segmentedControl selectedSegmentIndex] == 0){
    [rtcmixmanager playFile1];
    }
    else if([segmentedControl selectedSegmentIndex] == 1){
    [rtcmixManager playFile2];
    }
    else{
    [rtcmixManager playFile3];
    }
}

I have tried both this method, and adding a similar if statement in the RTCMixManager.m file under the -(IBaction) method itself, with no luck.
The project will compile but it seems to only play file 1, no matter which segment is highlited. does anyone know why this is?

  • 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-15T20:08:12+00:00Added an answer on June 15, 2026 at 8:08 pm

    Try this:

    -(IBAction)segmentChanged:(id)sender{
        UISegmentedControl *segControl = ((UISegmentedControl *)sender);
        if([segControl selectedSegmentIndex] == 0){
            [rtcmixmanager playFile1];
        }else if([segControl selectedSegmentIndex] == 1){
            [rtcmixManager playFile2];
        }else{
            [rtcmixManager playFile3];
        }
    }
    

    And connect it to the “value changed” of the Segmented Control event in the .xib file

    Edit:
    You can also do it in code like this:

    [segmentedControl addTarget:self action:@selector(segmentChanged:) forControlEvents:UIControlEventValueChanged];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an iOS app which is OpenFeint enabled. I have managed to get
I am making an iOS calculator app in which the scientific notion is enabled
I am making an iOS app which receives push notifications. Everything is set up
I am recently making an app which needs to exchange messages between different iOS
I am new to developing iOS apps. I am currently making an app which
I'm making an iOS app in which, if memory were not an issue, there
I am new to iOS application development. I am making an app in which
I'm making an iOS app that needs to load some youtube videos. I was
I'm making an iOS app using AIR 3.1 and Flex 4.5.1, and if I
I am making an AIR for iOS app that can download pdfs. I do

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.