Note that there are some explanatory texts on larger screens.

plurals
  1. PONSOperation, observer and thread error
    primarykey
    data
    text
    <p>I've got a problem with <code>NSOperation</code> and observer.</p> <p>I've a <code>tabbarcontroller</code> and a <code>splashController</code>. I want the splashscreen load and download the file and when the file is downloaded make the <code>tabbarcontroller</code> appear to the screen.</p> <p>The problem is that i 've an error :</p> <blockquote> <p>bool _WebTryThreadLock(bool), 0x3d2fa90: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...</p> </blockquote> <p>This is my code :</p> <pre><code>- (void)applicationDidFinishLaunching:(UIApplication *)application { queue = [[NSOperationQueue alloc] init]; NSString *path = [NSString stringWithFormat:@"%@flux.xml",DOCPATH]; //Le fichier existe dans le repertoire des documents if([[NSFileManager defaultManager] fileExistsAtPath:path]) [window addSubview:tabBarController.view]; else { splash = [[SplashController alloc] init]; [window addSubview:splash.view]; } DataLoadOperation *operation = [[DataLoadOperation alloc] initWithURL:[NSURL URLWithString:@"http://sly.33.free.fr/flux.xml"]]; [self.queue addOperation:operation]; [operation addObserver:self forKeyPath:@"isFinished" options:NSKeyValueObservingOptionNew context:nil]; } -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; NSLog(@"fini"); } </code></pre> <p>Could anyone help me ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload