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

  • Home
  • SEARCH
  • 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 6953623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:30:11+00:00 2026-05-27T14:30:11+00:00

In my app, I use custom UITableViewCells loaded from a XIB. Each cell contains

  • 0

In my app, I use custom UITableViewCells loaded from a XIB. Each cell contains 4 objects, like a UIImageView, UILabel, UITextField, etc…

I set the tag of each object in my cellforrowatindexpath so each object has the same tag which also is the row of the cell in the tableview.

The problem is, how am I suppose to access these objects in a cell if they all have the same tag? How would I properly access these objects in a method that doesn’t have a NSIndexPath parameter?

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-05-27T14:30:12+00:00Added an answer on May 27, 2026 at 2:30 pm

    I personally try avoiding the use of tags as I usually overuse them to the point of utter confusion and have begun finding more elegant ways around it. For instance, in your situation I would create IBOutlets for the custom UITableViewCell‘s objects making them more semantically relevant. However, your situation might be different – there is not enough in the question for me to say this would definitely work for you.

    That said, it sounds like you could accomplish what you’re trying to do by:

    1. Giving each cell returned by the cellForRowAtIndexPath method a tag (before returning it)
    2. Giving each of the objects within the cell a tag, as you seem to have already done

    That way you can access the cell’s objects (presumably UIViews) from (anywhere) in your UITableViewController by:

    UITableViewCell *cell = (UITableViewCell *)[self.tableview viewWithTag:CELL_TAG];
    UIView *objectInCell = [cell viewWithTag:OBJECT_TAG];
    

    Keep in mind that this would allow you to access an object in a specific cell. If you were trying to access the objects of all your cells, you could simply iterate through all of them. However, I sense that this would start becoming unnecessarily complicated at this point. It would help if you posted up a bit more information on what exactly you were trying to achieve by utilising the tagging this way. Hope this helps in the meantime.

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

Sidebar

Related Questions

I'm using a UISlider in my app but I'd like to use a custom
We use custom settings in a SalesForce app. We access it like so: MySettings__c
In my app, I use a custom NIB to load my UITableViewCells. The NIB's
In my app I have a UITableView that contains custom UITableViewCells. Scrolling is very
IN my app I use a threadpool with a custom ThreadFactory. My code looks
In my rails app I use the validation helpers in my active record objects
In my web app I use several asmx (Web Services) from the same provider,
I'm trying to use custom font for my iOS app. Here is what I
I want to use custom url schemes in my app, for example calling navigons
I have several parts in my app where I use custom table view cells.

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.