Ios8 黑色sceen试图在飞溅后放置.Xib
我正在为iOS 8编写一个应用程序。我有一个问题,因为我不想使用故事板,我想在第一时间放一个.xib文件。最大的问题是,每次喷溅后都会出现黑屏 我想放在Splash后面的类是LoginViewController 在常规选项中,如果输入类的名称,则主界面为白色空,我有NSException NSUknownexException 在.xib文件中,我连接了文件所有者,并在屏幕右侧显示了自定义类LoginViewController中的类名称 我的appDelegate.h是:我尝试使用@property strong,非原子LoginViewController*viewController;太Ios8 黑色sceen试图在飞溅后放置.Xib,ios8,Ios8,我正在为iOS 8编写一个应用程序。我有一个问题,因为我不想使用故事板,我想在第一时间放一个.xib文件。最大的问题是,每次喷溅后都会出现黑屏 我想放在Splash后面的类是LoginViewController 在常规选项中,如果输入类的名称,则主界面为白色空,我有NSException NSUknownexException 在.xib文件中,我连接了文件所有者,并在屏幕右侧显示了自定义类LoginViewController中的类名称 我的appDelegate.h是:我尝试使用@prop
#import <UIKit/UIKit.h>
#import "LoginViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UIViewController *viewController;
@end
LoginViewController.h:
#import <UIKit/UIKit.h>
@interface LoginViewController : UIViewController
{
IBOutlet UILabel *labelPrueba;
IBOutlet UIButton *botonPrueba;
IBOutlet UIButton *boton2prueba;
IBOutlet UILabel *label2Prueba;
IBOutlet UILabel *dsfd;
IBOutlet UIButton *dfdf;
}
@end
有人能帮我吗。我要发疯了
非常感谢。解决方案是将windows像init框架一样放置:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// That was the solution
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// That was the solution
self.viewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
navController.navigationBarHidden = YES;
self.window.rootViewController = navController;
[self.window makeKeyAndVisible];
return YES;
}
谢谢
#import "LoginViewController.h"
@interface LoginViewController ()
@end
@implementation LoginViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
label2Prueba.text = @"laaaaaaaaaaaaa";
NSLog(@"Entra en viewDidLoad");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// That was the solution
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// That was the solution
self.viewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
navController.navigationBarHidden = YES;
self.window.rootViewController = navController;
[self.window makeKeyAndVisible];
return YES;
}