0

嗨朋友,我的应用程序通过这样做而崩溃了我的代码中的问题我收到了这个错误消息应用程序应该在应用程序启动结束时有一个根视图控制器

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
//------------------------------------------------------------------------------------------------------------------\\
              ///  ************** This is for create  the  sqlite  data base**************** \\\

                                  [BaseModal copyDatabaseIfNeeded];
    //self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    CheckForUpdatesModal *CFUM = [[CheckForUpdatesModal alloc]init];
    [CFUM sendRequest];
    [CFUM release];

    // Override point for customization after application launch.
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(CallingtheSplashScreen:)
                                                 name:@"uniqueNotificationName"
                                               object:nil];
    [self.window makeKeyAndVisible];



    return YES;
}
-(void)CallingtheSplashScreen:(NSNotification *)notification
{
    //self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    SSView = [[[SplashScreenView alloc]initWithNibName:@"SplashScreenView" bundle:nil]autorelease];
   // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    SSView.Progrestotal = [[[notification userInfo]valueForKey:@"SUM"]intValue];
    [self.window addSubview:SSView.view];
   // self.window.rootViewController=SSView;
   // [[self window] setRootViewController:SSView];
    [[NSNotificationCenter defaultCenter] removeObserver:self];

}
4

1 回答 1

1

您可以使用以下代码,

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ 
    NSLog(@"Rahul"); // Here you can define your code to execute in  background.}); self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
于 2012-07-23T10:14:20.690 回答