Please note that I am trying to learn iphone and for this problem, i can’t figure out any solution.
I have created an empty view with the name of Loading. I have filled its Loading.xib with some images. Now this is the code I am using
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
Loading *firstView = [[Loading alloc]init];
self.navigationController = [[UINavigationController alloc]init];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
[self.navigationController pushViewController:firstView animated:YES];
// Override point for customization after application launch.
[self.window addSubview:self.navigationController.view];
[window makeKeyAndVisible];
return YES;
}
The problem is , when ever i run the code, it just shows the blank screen.
How can i load the loading screen. Any recommended tutorial links are welcomed
@implementation Loading
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
Best Regards
First of all, Loading is a view not view controller. You shouldn’t push it with navigation controller.
Secondly, it is not a good idea to add the navigation controller’s view to the window.
Please check this thread for more detail about
UIViewandUIViewControllerInstead, you may want to create a LoadingViewController, and change its view(XIB file) as what you want, then use code like this