简体   繁体   中英

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. 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. 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. As you mentioned you are using Xcode 6, try this code with Xcode 7+. Check Frameworks-> WebKit.framework-> Headers-> WKWebView.h-> Line 229

/*! @abstract The custom user agent string or nil if no custom user agent string has been set. */ @property (nullable, nonatomic, copy) NSString *customUserAgent API_AVAILABLE(macosx(10.11), ios(9.0));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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