I have an application which loads a lot of data. I have the data loading on a separate thread, but while it loads I would like to show a splash screen. For the splash screen I created a NIB file, but I can’t get the NIB to display. I’m not really sure what I’m doing wrong. If anyone can help, I’d greatly appreciate it. Here is the code:
Header file:
@interface DigiWireCDAppDelegate : NSObject <UIApplicationDelegate> {
--
UIWindow *window;
--
UIView *loadingView;
UIActivityIndicatorView *loadingAnimationIndicator;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
--
@property (nonatomic, retain) IBOutlet UIView *loadingView;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *loadingAnimationIndicator;
--
Implementation:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self loadData];
[loadingAnimationIndicator startAnimating];
loadingView.hidden = NO;
[window addSubview:loadingView];
[window bringSubviewToFront:loadingView];
[self.window makeKeyAndVisible];
return YES;
}
In case this helps, here is the NIB:

Just because you have something set as an IBOutlet doesn’t mean the xib will load automatically. In your
applicationDidFinishLaunching:you want to[[NSBundle mainBundle] loadNibNamed:@"loadingView" owner:self options:nil];in order to actually load the xib into memory.