Shivbaba's son
Shivbaba's son

Reputation: 1369

trouble setting too many outlets?

Actually I am converting an iPhone app to iPad.

For that I need to resize the "FONTS" of the labels.

There are many "title" called labels.

So, What I am doing now taking outlets of every label and setting the size of a font when the device is iPad.

There are too many labels so, 1) is there any way to set multiple outlets. to single instance so if I change one instance reflect to all?

2) is there any other method to change the size.

Upvotes: 0

Views: 80

Answers (2)

visakh7
visakh7

Reputation: 26400

If you are changing the fonts of all the labels within the view why not give this a try

if([self isPad])
    {
        [btnReset.titleLabel setFont:BUTTON_FONT_iPAD_BOLD];
        [btnViewReport.titleLabel setFont:BUTTON_FONT_iPAD_BOLD];
        scrollView.contentSize = CGSizeMake(768,1200);
        for(UILabel *label in [self.view subviews]) {
           if([label isKindOfClass:[UILabel class]]) 
           label.font = LABEL_FONT_iPAD_REPORT;
        }
}

Upvotes: 2

Chuck
Chuck

Reputation: 237060

Stuff them all in an array, then do [yourArray makeObjectsPerformSelector:@selector(setFont:) withObject:LABEL_FONT_iPAD_REPORT].

Upvotes: 1

Related Questions