I have a UIViewController in storyboard that includes a scrollView.
I want to put two UIImageViews and some UILabels on it.
the idea that I am thinking is : create a .xib file. Put a UIView on it, an then set my UIImageview and labels on this UIView.
Finally add my UIView which is a .xib file to my UIScrollView like this:
NSArray *views = [[NSBundle mainBundle] loadNibNamed:@"OfferView" owner:self options:nil];
UIView *newPageView = [views lastObject];
self.newPageView.contentMode = UIViewContentModeScaleAspectFill;
newPageView.frame = frame;
[self.scrollView addSubview:newPageView];
[self.pageViews replaceObjectAtIndex:page withObject:newPageView];
Now I want to set Text and image for the controls on the UIView programatically in my UIViewController. I try this but it did not work:
OfferUIView *offer2 = [[OfferUIView alloc] init];;
offer2.labelCompany.text = @"some text";
I also defined OfferUIView in the interface of ViewController and then synchronize, but it did not help also:
@property (nonatomic, assign) OfferUIView *offerView;
Can you help me?
Set the pointer for your
OfferViewwhen you load the nib to yourofferViewpropertyAnd when you want to change it: