我didFailToReceiveAdWithError在模拟器和设备上运行时在控制台中收到消息.
在iOS 8上运行时,iAd横幅会成功显示.在iOS 9上运行时,iAd横幅无法接收广告.
.H
#import <iAd/iAd.h>
@interface ViewController : UIViewController <ADBannerViewDelegate>
@property (retain, nonatomic) IBOutlet ADBannerView *adBanner;
Run Code Online (Sandbox Code Playgroud)
.M
-(void)viewDidLoad {
self.adBanner = [[ADBannerView alloc]initWithFrame:CGRectMake(0,[UIScreen mainScreen].bounds.size.height-100, [UIScreen mainScreen].bounds.size.width, 50)];
self.adBanner.delegate=self;
[self.adBanner setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:self.adBanner];
}
-(void)bannerViewWillLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewWillLoadAd");
}
-(void)bannerViewDidLoadAd:(ADBannerView *)banner {
// Show the ad banner.
NSLog(@"bannerViewDidLoadAd");
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 1.0;
}];
}
-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
NSLog(@"didFailToReceiveAdWithError");
// Hide the ad banner.
[UIView animateWithDuration:0.5 animations:^{
self.adBanner.alpha = 0.0;
}];
}
-(void)bannerViewActionDidFinish:(ADBannerView …Run Code Online (Sandbox Code Playgroud) 我有一个返回lat的GPS类,很长.我正试图通过地理编码器从该坐标获取城市名称或地址.它运作良好.
但是,是否有可能获得城市名称或任何没有地理编码器或(lat-long)的东西?
我的问题很严重CocoaPod.我不得不Cocoa pods为Yosemite 更新.然后我运行pod更新并收到以下警告消息:
[!] The `app [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Run Code Online (Sandbox Code Playgroud)
和
[!] The `app [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build …Run Code Online (Sandbox Code Playgroud)