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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:12:37+00:00 2026-05-15T03:12:37+00:00

I know this question was already asked in the past, but i am really

  • 0

I know this question was already asked in the past, but i am really confused and can’t get out of it.

i have got 9 pointers to IB objects declared like:

IBOutlet UIButton *but1;

IBOutlet UIButton *but2;

….

NSMutableArray *buttons;

declared properties:

@property (nonatomic,retain) IBOutlet UIButton *but1;

@property …..

in IB i have made the connections from buttons to pointers.

I need now to fill the array buttons with these pointers to run UIButton methods like

[[buttons objectWithId:0] setImage:[UIImage imageNamed:@"image1.png"]];

I know i can’t fill arrays with pointers, is there some way to get IBOutlets into arrays?

  • 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-15T03:12:38+00:00Added an answer on May 15, 2026 at 3:12 am

    Your overthinking the problem. By default, all references to all objects are pointers.

    This:

    IBOutlet UIButton *but1;
    

    … defines a pointer.

    Therefore, all default operations with objects use pointers. You usually don’t even have to think about it. To add a pointer to a UIButton to a NSMutableArray just use (note the self notation):

    [self.buttons addObject:self.but1];
    

    The IBOutlet designation has not effect on references in code. It is just there so Interface Builder can parse source and figure out which properties is supposed pay attention to. Otherwise, it does nothing and you can ignore it.

    Of course, I have to ask: Why are you putting buttons that are already named properties into an array?

    Instead of this:

    [[buttons objectWithId:0] setImage:[UIImage imageNamed:@"image1.png"]];
    

    … why not just do this?

    [self.but1 setImage:[UIImage imageNamed:@"image1.png"] forState:UIControlStateNormal]; 
    

    There’s not much sense in using named properties if you don’t use the names as the primary reference.

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

Sidebar

Related Questions

Okay, I know this question have been asked plenty of times already, but I
I know this question already have been asked. But I could not find any
I know this question might have been asked a few times already, but I
I have already asked this question in offical Flot google groups, but got no
I know this question has probably been asked already but I would really like
I know this question have been already asked ( here ), but all the
I know I asked this question already many times, but I did not get
I know this question has already been asked a lot, but I don't get
I know this question might have already been discussed a thousands of times but
sorry I know this question was asked already but the solution doesn't work for

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.