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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:12:07+00:00 2026-06-01T17:12:07+00:00

I am writing an iOS app and I have one question to make the

  • 0

I am writing an iOS app and I have one question to make the reading easier.

For example, I have many things to hide so I do this like this :
mytext1.hidden=YES;
mytext2.hidden=YES;
mytext3.hidden=YES;
…

Is there any way to write this :
(mytext1, mytext2, mytext3).hidden =YES;

?

Thanks

  • 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-01T17:12:08+00:00Added an answer on June 1, 2026 at 5:12 pm

    You can iterate an array with a selector like this:

    [theArray makeObjectsPerformSelector:@selector(methodName)];
    

    …and there’s a variation that takes a single object parameter. This won’t handle scalar types, though, so to set hidden=YES, you can enumerate using a block:

    [theArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
        (UITextField *)obj.hidden = YES;
    }];
    

    If that’s too verbose for your taste, you can add methods to the array class that assume, say, a collection of controls. These would just conceal the enumeration, but the caller could be as simple as this:

    [myArrayOfControls hidden:YES];
    

    Easy on the eyes, right? You can achieve this by creating your own custom category of NSArray methods:

    // in Array+UIControlEnumeration.m
    
    @implementation NSArray (UIControlEnumeration)
    
    - (void)hidden:(BOOL)hidden {
    
        for (UIControl *control in self) {
            control.hidden = hidden;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently writing an iOS app and I have many records that I'm writing
I'm writing an iOS app that acts as, among other things, a telnet server.
I have an app I am writing for iOS and Android. On startup I
I'm writing an iOS app and I have a UITableView that starts out with
For an ios app I'm writing, I'd like to take an photo from the
I'm writing an iOS app, and I'm noticing I have a couple ways to
i'm currently writing an iOS app that works with audio files, and one part
I am writing an iOS app, and I have to display a UIAlertView with
I am currently writing an iOS app and do not like the speed at
In the iOS app I'm writing, we have an add photo button that's pretty

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.