我有一个在按下按钮时触发的方法。这是大部分的实现:
[self.placeDictionary setValue:@"166 Bovet Rd" forKey:@"Street"];
[self.placeDictionary setValue:@"San Mateo" forKey:@"City"];
[self.placeDictionary setValue:@"CA" forKey:@"State"];
[self.placeDictionary setValue:@"94402" forKey:@"ZIP"];
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressDictionary:self.placeDictionary completionHandler:^(NSArray *placemarks, NSError *error) {
if([placemarks count]) {
CLPlacemark *placemark = [placemarks objectAtIndex:0];
CLLocation *location = placemark.location;
CLLocationCoordinate2D coordinate = location.coordinate;
PFGeoPoint* userLocation = [PFGeoPoint geoPointWithLatitude:coordinate.latitude longitude:coordinate.longitude];
NSLog(@"%f,%f", userLocation.latitude, userLocation.longitude);
} else {
NSLog(@"location error");
return;
}
}];
但是,我收到以下异常:
*** WebKit discarded an uncaught exception in the webView:shouldInsertText:replacingDOMRange:givenAction: delegate: <NSUnknownKeyException> [<__NSDictionaryI 0x873a3c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Street.
我完全不知道这个例外意味着什么。有人可以帮我理解为什么它会产生这个吗?