Je ne sais pas pourquoi j'obtiens cette erreur. J'obtiens également un problème EXC_BAD_ACCESS du code suivant. Des idées pourquoi? L'exécution des points d'arrêt sur les didRecieveResponse
et didRecieveData
et didFinishLoading
montre les deux premières opérations d'exécution et à mi-chemin des données de réception, le programme se bloque.l [20] ve: type de bloc invalide?
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
// starts... :)
plistContentsData = [NSMutableData data]; //NSMutableData - inst in head
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[plistContentsData appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
mellowListings = [[NSArray alloc] initWithData:plistContentsData]; //NSArray - inst in head
NSLog(@"%@",mellowListings);
CLLocationCoordinate2D newLocation;
int counter = 0;
for(NSDictionary *tempDict in mellowListings){
NSLog(@"%f",([[tempDict objectForKey:@"lat"] floatValue]));
NSLog(@"%f",([[tempDict objectForKey:@"long"] floatValue]));
newLocation.latitude = ([[tempDict objectForKey:@"lat"] floatValue]);
newLocation.longitude = ([[tempDict objectForKey:@"long"] floatValue]);
TCPlaceMarker *placemark = [[TCPlaceMarker alloc] initWithCoordinate:newLocation];
placemark.title = [tempDict objectForKey:@"name"];
placemark.subtitle = [tempDict objectForKey:@"address1"];
placemark.source = [[tempDict objectForKey:@"source"] lowercaseString];
placemark.tag = counter;
[mapView addAnnotation:placemark];
counter++;
}
}
ah, cela fonctionne. :) Merci, euh, d'avoir quand même l'erreur "type de bloc invalide". :(des idées là? –
Dans quelle ligne (ou méthode) obtenez-vous cette erreur? – Vladimir
Je n'ai aucune idée - avec des points d'arrêt dans l'erreur ne se produit pas:/ –