初始化期间无法成功更新网络信息 [英] Could not successfully update network info during initialization

查看:1240
本文介绍了初始化期间无法成功更新网络信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我第一次启动应用程序时,我一直都会遇到上述问题。
当我第一次启动应用程序时,我进行服务器调用以获取一些数据,然后播放动画视频。服务器调用位于与主UI线程不同的线程中。
是否与Network Reachability或动画视频有关?我认为第一部分是主要问题,但无法一直重现。

I get the above mentioned issue all the time when I first launch the app in the day. When I first launch the app, I make server calls to get some data and then play animation video. Server calls is in a separate thread than main UI Thread. Is it something to do with Network Reachability or the animation video ? I think the first part is the major issue but cannot recreate this all the time.

有没有人遇到过这个问题?

Has anyone experienced the issue ?

以下是我首次启动应用时的代码。

Below is the code when I first launch the app.

override func viewDidLoad() {
        super.viewDidLoad();


        self.navigationController?.navigationBarHidden = true;
        self.view.backgroundColor = UIColor.whiteColor();
           dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { () -> Void in
            Items.setup(); //AFNetworking call
        };

        animationViewController.delegate = self;
        animationViewController.view.autoresizesSubviews = true;
        animationViewController.view.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin];
        animationViewController.view.center = CGPointMake(self.view.bounds.size.width / 2, self.view.bounds.size.height / 2);

        self.view.addSubview(animationViewController.view);    

    }


推荐答案

我有通过以下步骤在Xcode 9.1中解决了这个问题。

I have resolved this issue in Xcode 9.1 with below steps.

1.选择模拟器
2.从顶部菜单项中选择Debug。
3.从调试菜单列表中选择位置。
4.选择Apple位置。

1.Select Simulator 2.Select Debug from top menu items. 3.Select Location from Debug menu list. 4.Select Apple location.

这篇关于初始化期间无法成功更新网络信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆