URL を読み込むのに非常に時間がかかる NSURL があります。スピナーを表示する必要があります。以下のコードを使用していますが、最初に黒い画面が表示されるのはスピナーではありません。アプリが必要です。 URL の読み込みが完了するまで、最初にスピナーを起動するようにします。これについて誰でも助けてもらえますか。大歓迎です。
[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];