ok, so you need to create it in the Application Delegate once. in .h
@property(nonatomic,strong) uiviewcontroller headerview;
in .m
@synthesize headerview=_headerview;
then highlight it in "doneFinishLaunchingWithOptions" in appdelegate as singleton
self.headerview = [[headerview alloc] initWithNibName:@"headerview" bundle:nil];
So, every time you want to add it to your view. Create an object from the application delegate in your class after importing it.
applicationdelegate app = [uiapplication sharedapplication]delegate]; [self.view addsubview:app.headerview.view];
Mina nabil
source share