objective c - Do you tag your UIViews or retain them as properties? -


This is mostly a stylish question but I'm curious what other people's thoughts have been since I started programming for the iPhone was. When you have UIView in your iPhone application and you need to access it in your app elsewhere (usually in another view controller in another function), do you prefer to tag the view with an integer and Want to retrieve it with the viewWithTag: message, or in general for easy access later, set it to a property in the View Controller ?

Saving it as a property makes it easy to get it later, but I think that something (probably negligible) is the amount of memory that it can set as an object property rather than any The scene is saved by tagging.

I am generally making properties on my view controllers, mainly because I am lazy, and getting rectangular views with the visuals tag: is upset.

There is no memory in it, properties can be avoided without being used - a property is only a Generates a small code that indicates your view, refers to an example variable, which is where y is located or not.

The use of the Viswyth tag is always more expensive and slower, because it is known through the hierarchy of viewing the call that each value has a tag value.

I always use IBotlet instance variables, and sometimes I add tags to such controls where I do not have to do anything, tell which special control is called a representative method Which can be activated with some different controls, it is a little less efficient but in that case the code is easy to maintain.


Comments