Let's say the tag is 7.
[contentView viewWithTag:7]
That returns the tag, if a subview (including the view itself, contentView
in this case) has this tag or nil if none is found. You are in charge with making sure to have the tags unique. For that you should never ever use 0 as tag value because 0 is the default value [contentView viewWithTag:0]
would return contentView
unless you set its tag to something else.