我在 Xcode 中创建了 Universal App(单一视图)。因为我想iAd
在每个视图上都有横幅,所以我将此代码添加到AppDelegate
文件中:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
if var root = self.window?.rootViewController
{
let contentFrame = UIScreen.mainScreen().bounds
var _banner = ADBannerView(adType: ADAdType.Banner)
_banner.frame=CGRectMake(0, contentFrame.height - _banner.frame.height, _banner.frame.width, _banner.frame.height)
_banner.delegate = self
root.view.addSubview(_banner)
}
return true
}
在真正的 iPhone(iOS 8)上一切正常(横幅出现在每个视图上)但我收到此错误:
<Error>: CGAffineTransformInvert: singular matrix.
如果我尝试在模拟器(iOS 8)上运行这个应用程序,行为是一样的。一切正常,我得到同样的错误,但我得到:*ADBannerView:
Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:):
Error Domain=ADErrorDomain Code=7 "The operation couldn’t be completed. Ad was unloaded from
this banner" UserInfo=0x7b83bf30 {ADInternalErrorCode=7, ADInternalErrorDomain=ADErrorDomain,
NSLocalizedFailureReason=Ad was unloaded from this banner}*
但我有委托,我实施了didFailToReceiveAdWithError
. 在真正的 iPhone 上它可以工作...
我的问题是如何解决这两个特定错误?