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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:34:44+00:00 2026-05-27T10:34:44+00:00

When you build a lot of equal object is a good design partner set

  • 0

When you build a lot of equal object is a good design partner set a tag to identifier, so:

UITextField *object1, *object2;
//Initialize it
[object1 setDelegate:self];
[object2 setDelegate:self];
[object1 setTag: 1]; 
[object2 setTag: 2];

To be more easy and “beautiful” understand the code, you can create a enum.

typedef enum {
      MyTextField1 = 1,
      MyTextField2
} allTextField;

So, you will not put just a number and can set tag in this way:

[object1 setTag: MyTextField1];
[object2 setTag: MyTextField2];

Than in any delegate function you can treat it more easy

- (BOOL)textFieldShouldClear:(UITextField *)textField {
   switch(textField.tag) {
       case MyTextField1: return YES;
       case MyTextField2: return NO;
   }
}

But, when you will build in Interface Builder in XCode, you can set the tag in this field:

enter image description here

But if I set it, I will receive:

enter image description here

There is no way to set the tag anything than a number in Interface Builder?

  • 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-27T10:34:45+00:00Added an answer on May 27, 2026 at 10:34 am

    There is no way to use an enum in IB. Because IB files are serialized objects. And when they get loaded at run time, they can’t make the reference to the name of the enum.

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

Sidebar

Related Questions

We build complicated console-based tools that produce a lot of commentary on the console.
I'm struggling a lot trying to get our build server going. I am currently
I am trying to build a data mart. I have lot of dimensions, and
I'm seeing a strange build bug a lot. Sometimes after typing some code we
a lot of my friends are using Python to build their mobile applications and
I want to build a service layer which consumes a lot of SOAP and
I want to build an application which will use a lot of data, trying
i'm starting to build a part of a system which will hold a lot
I help maintain and build on a fairly large Swing GUI, with a lot
Background As CopyLocal=true causes a lot of build slowdowns as projects and solutions grow

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.