Was wondering if someone can help me with this error warning which I am receiving in Xcode. I think it has something to do with 32 v 64bit. I would like the code to work in both 32 and 64bit. The relevant section of code is:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSLog(@"expected:%ld, got:%ld", (long)UIWebViewNavigationTypeLinkClicked, navigationType);
NSLog(@"Main Doc URL:%@", [[request mainDocumentURL] absoluteString]);
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
[[UIApplication sharedApplication] openURL:[request mainDocumentURL]];
return NO;
many thanks
UIWebViewNavigationType
is defined as
typedef NS_ENUM(NSInteger, UIWebViewNavigationType) {
// ...
};
and NSInteger
is int
on 32-bit and long
on 64-bit platforms. Therefore you
should cast the value to long
NSLog(@"expected:%ld, got:%ld", (long)UIWebViewNavigationTypeLinkClicked,
(long)navigationType);
to make it compile without warnings (and work correctly) in all cases.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With