views:

152

answers:

1

I have a top list view in my current iPhone app, that's populated by code. I've assembled the view using Interface Builder, so it contains lot of UILabels.

Obviously I wouldn't like to have name1, name2, etc. outlets in my class, but prefer a name[10] array.

Is it possible to do so, and connect each item to the appropriate label?

A: 

you cannot do it in IB, but you can create an array in your init method and add all your labels to it.

BTW, you can set some tag to each label and define macro to access it. smth like

#define NAME[TAG] (UILabel*)[self.view viewWithTag:TAG]
Morion