Tej*_*uri 4 objective-c ios appdelegate
我没有使用 LaunchScreen.xib 。我正在使用故事板作为闪屏。我正在调用 API 来获取启动图像。我正在应用程序委托中执行此操作。我可以在视图控制器上显示图像,但是一旦显示图像,我就无法转到另一个控制器。
这是我在 AppDelegate 中的内容:
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
self.window.frame=CGRectMake(0, 200, 100,30);
[self.window addSubview:[self convertImage: image]];
//upto here everything is fine
//now i am trying to wait for 3 seconds and call another view controller
sleep(3);
ViewController *login=[[ViewController alloc]initWithNibName:@"Login" bundle:nil];
[self presentviewcontroller:....]; // not able to present another controller
}
Run Code Online (Sandbox Code Playgroud)
你可以使用:
[[self window].rootViewController presentViewController:login animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
雨燕3
self.window?.rootViewController?.present(viewController, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7034 次 |
| 最近记录: |