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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:48:00+00:00 2026-06-01T18:48:00+00:00

I need a way to get all UILabel s within a UIView without having

  • 0

I need a way to get all UILabels within a UIView without having to go through all the views within the UIView.

I have many other type of views, UIButtons, UIImageViews and it would be too long to go through all of them when I just need the UILabels.

I’m trying to avoid something like this:

for (UIView *view in myView.subviews) 
{
    if([view isKindOfClass:[UILabel class]])
    {
        UILabel *lbl = (UILabel*)view;
    }
}

Is it possible or am I dreaming?

  • 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-01T18:48:01+00:00Added an answer on June 1, 2026 at 6:48 pm

    Create an NSArray ivar which you can add all the UILabel‘s to.

    If you do it in code then as you create the UILabel just do

    NSMutableArray *labels = [[NSMutableArray alloc] init];
    
    // Repeat this for al labels
    UILabel *label = [[UILabel alloc] in...
    [labels addObject:label];
    
    // Then
    self.labels = [labels copy];
    

    If you use IB the declare your property like this

    @property (nonatomic, strong) IBOutletCollection(UILabel) NSArray *labels;
    

    and connect all the labels up to this.

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

Sidebar

Related Questions

I need a way to get a ( content ) MovieClip within a (
I need to find a way to get all Apache running request at a
I need to figure out the way to get all the records in a
As the title mentions I need a way to get all groups a group
I'm working with Android and I really need a fast way to get a
I need a quick easy way to get a string from a file in
I need to find a way to get at the request/response streams inside of
Is there a way to get the size at runtime ? I need to
I need to define an appender for log4net in a way that I get
Normally, we get first value that way: $(#color option:first).val() But I need something like

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.