2012-10-02 115 views
0

我有一个NSURL,需要很长的时间来加载网址,我需要显示一个微调,我使用下面的代码,但微调是不是第一件出现它显示首先是黑屏,我希望应用程序首次加载微调器,直到URL加载完成,任何人都可以请帮助,这将不胜感激。在启动屏幕上加载NSURL

[NSThread detachNewThreadSelector:@selector(showLoading) toTarget:self withObject:nil]; 


    NSURL *URL = [NSURL URLWithString:@"http://strappcenter.net/strapp-projects/ohs/admin/jsonstring.php"]; 
    //NSURL *URL = [NSURL URLWithString:@"http://strappcenter.net/strapp-projects/ohs/admin/jsonstring.php"]; 
    NSError *error; 
    NSString *stringFromFileAtURL = [[NSString alloc] 
            initWithContentsOfURL:URL 
            encoding:NSUTF8StringEncoding 
            error:&error]; 


    [NSThread detachNewThreadSelector: @selector(spinEnd) toTarget:self withObject:nil]; 

回答

0

你需要添加启动画面,就像你的第一个屏幕。
然后从互联网加载数据。
结账this tutorial