アプリにアラートがあり、ユーザーがOKボタンをクリックすると、新しいいくつかが開きます:しかし、このいくつかは空のままです...ボタンなどは表示されません(どういうわけか、背景が正しく表示されます)。
このアラートは、AppDelegate.m ファイルでアプリを初めて起動したときに開きます。
-(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
FirstVC *launchViewController = [[FirstVC alloc] init];
self.window.rootViewController = launchViewController;
[self.window makeKeyAndVisible];
}
}
UIWindow の使い方が間違っているのかもしれません。すべての回答に感謝します。(FirstVC は、アラート ボタンがクリックされた後に表示される viewController です)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
if (! [defaults boolForKey:@"notFL"]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle: @"Welcome"
message: @"..."
delegate: self
cancelButtonTitle:nil
otherButtonTitles:@"OK",nil];
[alert show];
[defaults setBool:YES forKey:@"notFL"];
}
}