I’m beginner with iPhone and want to know how to add a view in a window based application.
I crate the application, then I added the ViewControler+XIB to my project.
I include the .h file in both AppDelegate-Files.
Then I create a object of the View “StartViewController” with
StartViewController *startView;
and add the property in the AppDelegate.h file:
@property (nonatomic, retain) StartViewController *startView;
In the AppDelegate.m I add:
@synthessize startViewController
and in the application method:
[window addSubview:startViewController.view];
But it doesn’t appear when I start the application, what I forgot?
You’re not allocating or initializing it anywhere that I can see. From what you’re saying, it seems like you need to put in a
If this doesn’t sound right, it may instead be that you aren’t setting Interface Builder up right. How is the main window linking to this XIB / view controller of yours? Do you have it referenced as a view?