简体   繁体   English

在对象类型上找不到Sematice问题属性“ customUserAgent”

[英]Sematice Issue Property “customUserAgent” not found on object type

I am new to objective c but I have an app I was compiling and it's throwing errors on xcode 6. Any time I click archive the build fails and points to wkWebview.customUserAgent saying that Property not found on object type customUserAgent is not found on type WKWebview. 我对目标c还是陌生的,但是我正在编译一个应用程序,它在xcode 6上引发错误。每当我单击存档时,构建都会失败,并指向wkWebview.customUserAgent,说在对象类型customUserAgent上找不到属性WKWebview。 I have combed the web in search of solutions but I couldn't find. 我已经在网上搜寻解决方案,但找不到。 I am guessing that customUserAgent was not explicitly defined and I don't simply don't know how to. 我猜想customUserAgent没有明确定义,我也不只是不知道该怎么做。 I'll appreciate any pointer. 我将不胜感激任何指针。

  // re-create WKWebView, since we need to update configuration WKWebView* wkWebView = [[WKWebView alloc] initWithFrame:self.engineWebView.frame configuration:configuration]; wkWebView.UIDelegate = self.uiDelegate; self.engineWebView = wkWebView; if (IsAtLeastiOSVersion(@"9.0") && [self.viewController isKindOfClass:[CDVViewController class]]) { wkWebView.customUserAgent = ((CDVViewController*) self.viewController).userAgent; 

Please help. 请帮忙。

Issue is that you are calling property that is defined in latest version of OS. 问题是您正在调用最新版本的OS中定义的属性。 As you mentioned you are using Xcode 6, try this code with Xcode 7+. 如您所提到的,您正在使用Xcode 6,请在Xcode 7+上尝试使用此代码。 Check Frameworks-> WebKit.framework-> Headers-> WKWebView.h-> Line 229 检查Frameworks-> WebKit.framework-> Headers-> WKWebView.h-> 229行

/*! / *! @abstract The custom user agent string or nil if no custom user agent string has been set. @abstract定制用户代理字符串,如果未设置定制用户代理字符串,则为nil。 */ @property (nullable, nonatomic, copy) NSString *customUserAgent API_AVAILABLE(macosx(10.11), ios(9.0)); * / @属性(可空,非原子,副本)NSString * customUserAgent API_AVAILABLE(macosx(10.11),ios(9.0));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM