I have a custom UIView called ActivityDetailView that I instantiate and then add to a scrollview within a parent view controller. When this custom
This is not really the best way to create a custom view from your nib file. What I suggest you do is to add the view that you take from the .nib file as a subview to self. The code should look something like this.
-(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
NSArray *xibViews = [[NSBundle mainBundle] loadNibNamed:@"ActivityDetailView" owner:nil options:nil];
if ([xibViews count] < 1) return nil;
ActivityDetailView * xibView = [xibViews objectAtIndex:0];
[xibView setFrame:frame];
[self addSubview:xibView]; // This is where I have changed your code
}
return self;
}