I have a UIViewController calling another view Controller with a defined loadView method. I’ve been trying many options without success to solve the problem of the loadView method not called.
Any help is appreciated.
Thanks. MArcos
Caller UIViewController
#import "MyAlbumViewController.h"
@interface ViewController : UIViewController
@end
implementation
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidAppear:(BOOL)animated{
UIViewController*albumVC = [[MyAlbumViewController alloc] init];
[self.navigationController pushViewController:albumVC animated:YES];
}
@end
Called UIViewController
@interface MyAlbumViewController : NIToolbarPhotoViewController <NIPhotoAlbumScrollViewDataSource>
@end
Implementation
#import "MyAlbumViewController.h"
@implementation MyAlbumViewController
- (void)loadView{
[super loadView];
self.photoAlbumView.dataSource = self;
// Set the default loading image.
self.photoAlbumView.loadingImage = [UIImage imageWithContentsOfFile:
NIPathForBundleResource(nil, @"NimbusPhotos.bundle/gfx/default.png")];
self.title = NSLocalizedString(@"Loading...", @"Navigation bar title - Loading a photo album");
[self loadAlbumInformation];
}...