Wednesday, 11 September 2013

iOS SDK using loadNibNamed, code within 'init" not working as expected

iOS SDK using loadNibNamed, code within 'init" not working as expected

FluidInfo *fluidInfo = [[FluidInfo alloc]init];
UIView *info = [[[NSBundle mainBundle] loadNibNamed:@"FluidInfoSheet"
owner:fluidInfo options:nil] objectAtIndex:0];
[self createFormulaPopup:info];
I have a nib file with a UIView. and I have a subclass of UIView called
'FluidInfo.' I make this UiView appear as a popup inside my viewController
using my function 'createFormulaPopup'
I have made my UIView a subclass of FluidInfo. When I create outlets and
actions they are all working correctly.
The problem is that my init function within my UIView is working
unexpectedly. If I log something then it appears at the same time as my
popup.. but if i set something like background color of the view it seems
to disappear. If I set it in interface builder it will stick. If I attach
the change of the color to an action within UIView then that will work as
well. But when the view is initialized it seems to undo all the stuff I've
done programmatically.

No comments:

Post a Comment