Dans mon application, je souhaite afficher un message d'erreur si la connexion réseau est trop lente après quelques secondes. Comment devrais-je l'implémenter? Voici le code:Comment déclencher une action après un certain laps de temps?
-(void)setProjectID:(NSString *)newProject {
[self willChangeValueForKey:@"projectID"];
[projectID release];
projectID = [newProject copy];
[self didChangeValueForKey:@"projectID"];
// Since we have an ID, now we need to load it
NSInvocation *returnInvocation = [NSInvocation invocationWithMethodSignature:
[Detail instanceMethodSignatureForSelector:@selector(configureView:)]];
[returnInvocation setTarget:self];
[returnInvocation setSelector:@selector(configureView:)];
[returnInvocation retainArguments];
fetch = [[WBWDocumentFetcher alloc] init];
[fetch retrieveDocument:[NSURL wb_URLForTabType:PROJECT_DETAILS inProject:projectID] returnBy:returnInvocation];
}
-(void)configureView:(NSDictionary *)serverResult
{
}
Merci,
sur quel objet dois-je utiliser ce code. Je n'en vois pas dans mon code. – Ashutosh
Aussi comment dois-je vérifier si la page a chargé ou non? – Ashutosh
Sans voir votre code, c'est plutôt difficile à dire. Si vous utilisez un 'UIWebView', par exemple, alors vous voulez probablement le mettre dans' -webViewDidStartLoad: ' – PengOne