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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:50:38+00:00 2026-06-14T04:50:38+00:00

In my iPhone app I have used an UI Segment Controller with three segments.

  • 0

In my iPhone app I have used an UI Segment Controller with three segments.
I need to add a subView already created to the second segment,

for this I have used follow code

[segment addSubview:ImgVw forSegment:1];

[segment addSubview:BlueButton forSegment:3];

it prompts a warning

instance method addSubView for segment not found return type defaults to id

And crashes the app

Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UISegmentedControl addSubview:forSegment:]: unrecognized selector sent to instance 0x8a8a7a0’

I need to add different subViews for different segments in UISegment controller at many places

how?

  • 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-14T04:50:39+00:00Added an answer on June 14, 2026 at 4:50 am

    There is not method That allow you to insert UiView at particular segment in my opinion.

    But you can set custom image plz have a look to below Code

    NSArray *arrItem=[[NSArray alloc]initWithObjects:@"1", @"2",@"3",@"4",nil];
        UISegmentedControl *seg=[[UISegmentedControl alloc]initWithItems:arrItem];
        seg.frame=CGRectMake(10, 100, 300, 200);
        [seg insertSegmentWithImage:[UIImage imageNamed:@"SearchTransparent.png"] atIndex:2 animated:YES];
        [seg setWidth:90.0 forSegmentAtIndex:2];
        [self.view addSubview:seg];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to play audio file in my iphone app.I have used this
Some Background I have an iPhone app with three UIWebViews, each used to show
In my iPhone app I have a table view where I add a tick
I have successfully used APNS in iphone app and still have a problem the
I want to send mail from my custom iPhone app. I have used MFMailComposeViewController
developing iphone app, I have used a UIImageview and i have set an image
In my iPhone app, I am having a grouped table view. I have used
I am trying to play RTSP url in my iPhone app. I have used
I have an iPhone app (already in the App Store, free download) which requires
I have implemented an app in iPhone, (Objective-c) in that i have used SQLITE

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.