I was wondering if I can store a data object in a certain tag associated with a tableViewCell, for ease of access to the data associated logically to that cell.
So is there a property to store the data object in? for a TableViewCell?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The tag on a UITableViewCell (and on many other Cocoa classes) stores only an integer. You could use it to store some predefined constant, e.g.
or you could use a numbering scheme to save the model ID that corresponds to the cell, e.g.
In general, you can keep an array of data and use the tag as an index into it.