Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parse platform 如何防止在目标c中完成解析之前加载子视图_Parse Platform_Objective C Blocks - Fatal编程技术网

Parse platform 如何防止在目标c中完成解析之前加载子视图

Parse platform 如何防止在目标c中完成解析之前加载子视图,parse-platform,objective-c-blocks,Parse Platform,Objective C Blocks,请您解释一下,在解析完成之前,我如何防止子视图不加载。 下面我将描述我的具体情况。 我有根视图控制器,它开始解析查询 if ( !_languageList ) { [Language getAllObjectsWithBlockCompletion:^(NSArray *objects, NSError *error) { if ( error ) { NSString *message

请您解释一下,在解析完成之前,我如何防止子视图不加载。 下面我将描述我的具体情况。 我有根视图控制器,它开始解析查询

if ( !_languageList )
    {
        [Language getAllObjectsWithBlockCompletion:^(NSArray *objects, NSError *error) {

            if ( error )
            {
                NSString *message = error.localizedDescription;
                if ( !message )
                {
                    message = NSLocalizedString(@"Unable to get language list", nil);
                }

                [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil)
                                            message:message
                                           delegate:nil
                                  cancelButtonTitle:NSLocalizedString(@"Ok", nil)
                                  otherButtonTitles:nil] show];
            }
            else
            {
                _languageList = objects;
                _languageListViewController.languageList = objects;
            }

        }];
    }
完成后,结果将记录在子视图控制器属性中。 但当我的应用程序启动时,另一个视图首先加载,比如头带。有一个停止按钮,若用户快速按下它,则加载下一个子视图。有时,可以在从parse接收数据之前加载它

- (void) viewDidLoad
{
    [super viewDidLoad];

    if([InternetValidator isInternetEnable] == NO)
    {
      //  UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Check your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

      //  [message show];

        UIImageView *sprachoverlayy =[[UIImageView alloc] initWithFrame:CGRectMake(0,140,320,190)];
        sprachoverlayy.image=[UIImage imageNamed:@"nowifi.png"];
        [self.view addSubview:sprachoverlayy];
    }
    else
    {


        _splashViewController = [self.storyboard instantiateViewControllerWithIdentifier:[SplashViewController description]];
        [self addChildViewController:_splashViewController];

        _languageListViewController = [self.storyboard instantiateViewControllerWithIdentifier:[LanguageListViewController description]];
        [_languageListViewController setSelectionBlock:^(LanguageListViewController *sender, Language *language){

            [sender prepareForTransition:^{

                ScanViewController *controller = [sender.storyboard instantiateViewControllerWithIdentifier:[ScanViewController description]];
                controller.language = language;

                NSArray *viewControllers = [NSArray arrayWithObjects:sender, controller, nil];
                [sender.navigationController setViewControllers:viewControllers animated:NO];

            }];

        }];
        [_languageListViewController shouldScrollToLanguageWithCode:[_userDefaults objectForKey:UD_LANGUAGE_CODE] animated:NO];
        _languageNavigationController = [[NavigationController alloc] initWithRootViewController:_languageListViewController];
        [self addChildViewController:_languageNavigationController];

        _currentChildController = _splashViewController;
        [self.view addSubview:_currentChildController.view];
        [self _setupChildViewConstraints];

        _languageNavigationController.view.alpha = 0.0f;
        [_splashViewController performPresentationAnimationWithBlockCompletion:^{
            if([_languageListViewController.languageList count]==0){
                NSLog(@"No info");
            }
            [self _clearChildViewConstraints];
            [self transitionFromViewController:_currentChildController
                              toViewController:_languageNavigationController
                                      duration:0.5
                                       options:UIViewAnimationOptionCurveEaseInOut
                                    animations:^{

                                        _languageNavigationController.view.alpha = 1.0f;

                                    } completion:^(BOOL finished) {

                                        _splashViewController = nil;
                                        _currentChildController = _languageNavigationController;
                                        [self _setupChildViewConstraints];

                                    }];


        }];

    }
    }

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    if([InternetValidator isInternetEnable] == NO)
    {
        //   UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Check your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];

        //   [message show];
    }
    else
    {
        [self loadLangugeList];
    }

}