异步执行数据处理,不阻挡页面的显示

 

// 发送 imsi, 注册账号,此步是个消耗时间的操作,我们放在后台运行,不等待直接后面代码,显示窗口

  [self performSelectorOnMainThread:@selector(sendIMSI )

         withObject:nil

      waitUntilDone:NO];

// 显示程序主窗口

    [window makeKeyAndVisible];

 return YES;

-(void)sendIMSI {

 g_uiUserRegeditData=[g_ParseURL parseUserRegedit];

 if (g_uiUserRegeditData==nil) {

  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" 提示 "

              message:@" 连接服务器失败,请检查网络连接! "

                delegate:self

             cancelButtonTitle:@" 确定 "

             otherButtonTitles:nil];  

  [alert show];

  [alert release];

 }else {

  [window addSubview:navigationController.view];

  [window makeKeyAndVisible];

 }

你可能感兴趣的:(网络,服务器)