Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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 <code>IBOutlet</code>s for the custom <code>UITableViewCell</code>'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.</p> <p>That said, it sounds like you could accomplish what you're trying to do by:</p> <ol> <li>Giving each cell returned by the <code>cellForRowAtIndexPath</code> method a tag (before returning it)</li> <li>Giving each of the objects within the cell a tag, as you seem to have already done</li> </ol> <p>That way you can access the cell's objects (presumably <code>UIView</code>s) from (anywhere) in your <code>UITableViewController</code> by:</p> <pre><code>UITableViewCell *cell = (UITableViewCell *)[self.tableview viewWithTag:CELL_TAG]; UIView *objectInCell = [cell viewWithTag:OBJECT_TAG]; </code></pre> <p>Keep in mind that this would allow you to access an object in a <strong>specific</strong> cell. If you were trying to access the objects of <strong>all</strong> 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.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload