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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:23:35+00:00 2026-06-09T17:23:35+00:00

I have 30 UILabels I wish to use as IBOutlets. However when I try

  • 0

I have 30 UILabels I wish to use as IBOutlets. However when I try to access their UILabel properties I’m getting errors telling me that property x is not found for object of type ‘id’. I’m very rusty with Objective C so suspect I’ve done something fundamentally wrong. I’ve assigned all my labels to the IBCollection within the xib file.

.h

@interface ViewController : UIViewController
{
    IBOutletCollection(UILabel) NSArray *statPanels;
}
@property(retain) IBOutletCollection(UILabel) NSArray *statPanels;
@end

.m

@interface ViewController ()
@end

@implementation ViewController
@synthesize statPanels;

- (void)viewDidLoad
{
    [super viewDidLoad];

    statPanels = [[NSArray alloc] initWithObjects:[UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], nil ];

    [statPanels objectAtIndex:3].hidden = YES;
}
  • 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-09T17:23:37+00:00Added an answer on June 9, 2026 at 5:23 pm

    If you connected all of the labels in interface builder then you don’t have to initialize the statPanels array.

    Delete this line:

    statPanels = [[NSArray alloc] initWithObjects:[UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], [UILabel alloc], nil ];
    

    That line is creating a new array and a bunch of new labels, and losing your outlets.

    Also, you will need to cast like the other answer is saying:

    ((UILabel *) [statPanels objectAtIndex:3]).property = ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two UILabels. that I want to overlap one atop the other. Call
I have a NIB with a UIView that contains some UILabels, UIButtons etc. and
I have a UILabel that displays some chars. Like x, y or rpm. How
I have a bunch of UILabels that I add through code and I want
I have a view that consists of a bunch of UILabels. As of right
I have three UILabels of varying widths that I'd like to line up next
I have a UIScrollView that has a number of UILabels and UITextViews inside it.
I have two UILabels in a view that display my band and song name
I have several UILabels. I setup a UIScrollView within a app that works fine.
I have various UILabels that I would like to hide using a for-loop. @interface

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.