Add code to call viewWillLoad/viewDidLoad into loadView

This commit is contained in:
Gregory John Casamento 2022-12-10 12:44:03 -05:00
parent 5e5e2bd317
commit 20a59e45b5
2 changed files with 20 additions and 0 deletions

View file

@ -88,6 +88,9 @@ APPKIT_EXPORT_CLASS
- (NSString *)nibName;
- (NSBundle *)nibBundle;
- (void) viewWillLoad;
- (void) viewDidLoad;
@end
#endif // OS_API_VERSION

View file

@ -73,6 +73,14 @@
[super dealloc];
}
- (void)viewWillLoad
{
}
- (void)viewDidLoad
{
}
- (void)setRepresentedObject:(id)representedObject
{
ASSIGN(_representedObject, representedObject);
@ -124,6 +132,11 @@
return;
}
if ([self respondsToSelector: @selector(viewWillLoad)])
{
[self viewWillLoad];
}
nib = [[NSNib alloc] initWithNibNamed: [self nibName]
bundle: [self nibBundle]];
if ((nib != nil) && [nib instantiateNibWithOwner: self
@ -131,6 +144,10 @@
{
_vcFlags.nib_is_loaded = YES;
// FIXME: Need to resolve possible retain cycles here
if ([self respondsToSelector: @selector(viewDidLoad)])
{
[self viewWillLoad];
}
}
else
{