Using Interface Builder tags
Posted
by pat
on Stack Overflow
See other posts from Stack Overflow
or by pat
Published on 2008-12-15T18:33:58Z
Indexed on
2010/04/13
9:52 UTC
Read the original article
Hit count: 274
I'm using interface builder's tag feature to access some UILabels I'm instantiating in a xib file. Since this a UITextViewCell I want to avoid superfluous method calls, but I want to do it right too. Thus when I do:
UILabel *label = (UILabel *)[cell viewWithTag:1];
I'm wondering if I should wrap it up like so:
if([[cell viewWithTag:1] isKindOfClass [UITableViewCell class]]) {
UILabel *label = (UILabel *)[cell viewWithTag:1];
}
Any discussion on this would be appreciated.
Thanks
© Stack Overflow or respective owner