它在iOS 7上运行良好,但UIImageView的位置在iO8上移动,如下图所示.另外rightCalloutAccessoryView位置移动右上角.
有人可以帮忙吗?
干杯.
在iOS 7中

在iOS 8中

- (void)mapView:(MKMapView*)mapView didSelectAnnotationView:(MKAnnotationView*)view {
if(![view.annotation isKindOfClass:[MKUserLocation class]]) {
UBAnnotation *selectedAnnotation = view.annotation;
NSURL * imageUrlAtIndex = [NSURL URLWithString:[[self.objects objectAtIndex:selectedAnnotation.idx] ad_thumbImageUrl]];
UIImageView * leftCalloutView = [[UIImageView alloc] initWithFrame:CGRectMake(2, 2, 40, 40)];
[leftCalloutView setImageWithURL:imageUrlAtIndex];
leftCalloutView.layer.masksToBounds = YES;
leftCalloutView.layer.cornerRadius = 6;
view.leftCalloutAccessoryView = leftCalloutView;
}
Run Code Online (Sandbox Code Playgroud)
}
- (MKAnnotationView*)mapView:(MKMapView*)mapView viewForAnnotation:(id)annotation {
MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
if ([annotation isKindOfClass:[MKUserLocation class]]) {
return nil;
} else {
annView.image = [UIImage imageNamed:@"pin"];
annView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
annView.rightCalloutAccessoryView.tintColor = …Run Code Online (Sandbox Code Playgroud) 我的应用程序包含可消耗的IAP产品,当我使用以下代码调用验证收据时返回多个事务:
[[NSBundle mainBundle] appStoreReceiptURL];
Run Code Online (Sandbox Code Playgroud)
有没有办法只返回最后一笔交易?
它与恢复交易有关吗?
我检查了restoreCompletedTransaction inapp purchase的多次收据计数,这个iOS应用内购买恢复返回了许多交易.
我试图恢复所有购买但它没有用.
我正在使用这些线路来拨打收据:
- (void) checkReceipt {
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
if(!receipt) {
}
NSError *error;
NSDictionary *requestContents = @{@"receipt-data": [receipt base64EncodedStringWithOptions:0]};
NSLog(@"requestContents:%@", requestContents);
NSData *requestData = [NSJSONSerialization dataWithJSONObject:requestContents
options:0
error:&error];
if (!requestData) { }
NSURL *storeURL = [NSURL URLWithString:@"https://sandbox.itunes.apple.com/verifyReceipt"];
NSMutableURLRequest *storeRequest = [NSMutableURLRequest requestWithURL:storeURL];
[storeRequest setHTTPMethod:@"POST"];
[storeRequest setHTTPBody:requestData];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[NSURLConnection sendAsynchronousRequest:storeRequest …Run Code Online (Sandbox Code Playgroud)