From 02531ea7bef9a4e26df43762ff531473cdca469e Mon Sep 17 00:00:00 2001 From: Murat Baysangurov Date: Sun, 23 Jul 2017 21:02:21 +0300 Subject: [PATCH] Miscellaneous warnings fixed --- Classes/BITAttributedLabel.m | 45 ++++++++++++--------- Classes/BITAuthenticationViewController.m | 4 +- Classes/BITAuthenticator.m | 2 - Classes/BITChannel.m | 4 +- Classes/BITCrashManager.m | 2 +- Classes/BITDomain.m | 2 +- Classes/BITEnvelope.m | 2 +- Classes/BITFeedbackActivity.m | 2 +- Classes/BITFeedbackComposeViewController.m | 4 +- Classes/BITFeedbackListViewController.m | 5 +-- Classes/BITFeedbackMessageAttachment.h | 2 +- Classes/BITFeedbackUserDataViewController.m | 4 +- Classes/BITHockeyAttachment.m | 2 +- Classes/BITHockeyBaseViewController.m | 13 ++---- Classes/BITHockeyLogger.m | 3 +- Classes/BITPersistence.m | 2 +- Classes/BITSessionStateData.m | 2 +- Classes/BITTelemetryContext.m | 2 +- Classes/BITUpdateManager.m | 2 - Classes/BITUpdateViewController.m | 18 +++++---- Classes/BITWebTableViewCell.m | 3 -- 21 files changed, 59 insertions(+), 66 deletions(-) diff --git a/Classes/BITAttributedLabel.m b/Classes/BITAttributedLabel.m index 8943ff5e75..52f1585044 100644 --- a/Classes/BITAttributedLabel.m +++ b/Classes/BITAttributedLabel.m @@ -86,7 +86,10 @@ static inline CTTextAlignment CTTextAlignmentFromBITTextAlignment(BITTextAlignme case NSTextAlignmentLeft: return kCTLeftTextAlignment; case NSTextAlignmentCenter: return kCTCenterTextAlignment; case NSTextAlignmentRight: return kCTRightTextAlignment; - default: return kCTNaturalTextAlignment; + case BITTextAlignmentJustified: + case BITTextAlignmentNatural: + default: + return kCTNaturalTextAlignment; } #else switch (alignment) { @@ -170,6 +173,8 @@ static inline CGFloat BITFlushFactorForTextAlignment(NSTextAlignment textAlignme case BITTextAlignmentRight: return 1.0; case BITTextAlignmentLeft: + case BITTextAlignmentJustified: + case BITTextAlignmentNatural: default: return 0.0; } @@ -179,9 +184,9 @@ static inline NSDictionary * NSAttributedStringAttributesFromLabel(BITAttributed NSMutableDictionary *mutableAttributes = [NSMutableDictionary dictionary]; if ([NSMutableParagraphStyle class]) { - [mutableAttributes setObject:label.font forKey:(NSString *)kCTFontAttributeName]; - [mutableAttributes setObject:label.textColor forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableAttributes setObject:@(label.kern) forKey:(NSString *)kCTKernAttributeName]; + [mutableAttributes setObject:label.font forKey:(const NSString *)kCTFontAttributeName]; + [mutableAttributes setObject:label.textColor forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableAttributes setObject:@(label.kern) forKey:(const NSString *)kCTKernAttributeName]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.alignment = label.textAlignment; @@ -197,14 +202,14 @@ static inline NSDictionary * NSAttributedStringAttributesFromLabel(BITAttributed paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; } - [mutableAttributes setObject:paragraphStyle forKey:(NSString *)kCTParagraphStyleAttributeName]; + [mutableAttributes setObject:paragraphStyle forKey:(const NSString *)kCTParagraphStyleAttributeName]; } else { CTFontRef font = CTFontCreateWithName((__bridge CFStringRef)label.font.fontName, label.font.pointSize, NULL); - [mutableAttributes setObject:(__bridge id)font forKey:(NSString *)kCTFontAttributeName]; + [mutableAttributes setObject:(__bridge id)font forKey:(const NSString *)kCTFontAttributeName]; CFRelease(font); - [mutableAttributes setObject:(id)[label.textColor CGColor] forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableAttributes setObject:@(label.kern) forKey:(NSString *)kCTKernAttributeName]; + [mutableAttributes setObject:(id)[label.textColor CGColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableAttributes setObject:@(label.kern) forKey:(const NSString *)kCTKernAttributeName]; CTTextAlignment alignment = CTTextAlignmentFromBITTextAlignment(label.textAlignment); CGFloat lineSpacing = label.lineSpacing; @@ -232,7 +237,7 @@ static inline NSDictionary * NSAttributedStringAttributesFromLabel(BITAttributed CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(paragraphStyles, 12); - [mutableAttributes setObject:(__bridge id)paragraphStyle forKey:(NSString *)kCTParagraphStyleAttributeName]; + [mutableAttributes setObject:(__bridge id)paragraphStyle forKey:(const NSString *)kCTParagraphStyleAttributeName]; CFRelease(paragraphStyle); } @@ -275,7 +280,7 @@ static inline NSAttributedString * NSAttributedStringBySettingColorFromContext(N [mutableAttributedString enumerateAttribute:(NSString *)kCTForegroundColorFromContextAttributeName inRange:NSMakeRange(0, [mutableAttributedString length]) options:0 usingBlock:^(id value, NSRange range, __unused BOOL *stop) { BOOL usesColorFromContext = (BOOL)value; if (usesColorFromContext) { - [mutableAttributedString setAttributes:[NSDictionary dictionaryWithObject:color forKey:(NSString *)kCTForegroundColorAttributeName] range:range]; + [mutableAttributedString setAttributes:[NSDictionary dictionaryWithObject:color forKey:(const NSString *)kCTForegroundColorAttributeName] range:range]; [mutableAttributedString removeAttribute:(NSString *)kCTForegroundColorFromContextAttributeName range:range]; } }]; @@ -394,22 +399,22 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra self.linkBackgroundEdgeInset = UIEdgeInsetsMake(0.0, -1.0, 0.0, -1.0); NSMutableDictionary *mutableLinkAttributes = [NSMutableDictionary dictionary]; - [mutableLinkAttributes setObject:[NSNumber numberWithBool:YES] forKey:(NSString *)kCTUnderlineStyleAttributeName]; + [mutableLinkAttributes setObject:[NSNumber numberWithBool:YES] forKey:(const NSString *)kCTUnderlineStyleAttributeName]; NSMutableDictionary *mutableActiveLinkAttributes = [NSMutableDictionary dictionary]; - [mutableActiveLinkAttributes setObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCTUnderlineStyleAttributeName]; + [mutableActiveLinkAttributes setObject:[NSNumber numberWithBool:NO] forKey:(const NSString *)kCTUnderlineStyleAttributeName]; NSMutableDictionary *mutableInactiveLinkAttributes = [NSMutableDictionary dictionary]; - [mutableInactiveLinkAttributes setObject:[NSNumber numberWithBool:NO] forKey:(NSString *)kCTUnderlineStyleAttributeName]; + [mutableInactiveLinkAttributes setObject:[NSNumber numberWithBool:NO] forKey:(const NSString *)kCTUnderlineStyleAttributeName]; if ([NSMutableParagraphStyle class]) { - [mutableLinkAttributes setObject:[UIColor blueColor] forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableActiveLinkAttributes setObject:[UIColor redColor] forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableInactiveLinkAttributes setObject:[UIColor grayColor] forKey:(NSString *)kCTForegroundColorAttributeName]; + [mutableLinkAttributes setObject:[UIColor blueColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableActiveLinkAttributes setObject:[UIColor redColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableInactiveLinkAttributes setObject:[UIColor grayColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; } else { - [mutableLinkAttributes setObject:(__bridge id)[[UIColor blueColor] CGColor] forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableActiveLinkAttributes setObject:(__bridge id)[[UIColor redColor] CGColor] forKey:(NSString *)kCTForegroundColorAttributeName]; - [mutableInactiveLinkAttributes setObject:(__bridge id)[[UIColor grayColor] CGColor] forKey:(NSString *)kCTForegroundColorAttributeName]; + [mutableLinkAttributes setObject:(__bridge id)[[UIColor blueColor] CGColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableActiveLinkAttributes setObject:(__bridge id)[[UIColor redColor] CGColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; + [mutableInactiveLinkAttributes setObject:(__bridge id)[[UIColor grayColor] CGColor] forKey:(const NSString *)kCTForegroundColorAttributeName]; } self.linkAttributes = [NSDictionary dictionaryWithDictionary:mutableLinkAttributes]; @@ -709,7 +714,7 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra BITAttributedLabelLink *link = nil; - for (NSInteger i = 0; i < count && link.result == nil; i ++) { + for (size_t i = 0; i < count && link.result == nil; i ++) { CGPoint currentPoint = CGPointMake(point.x + deltas[i].x, point.y + deltas[i].y); link = [self linkAtCharacterIndex:[self characterIndexAtPoint:currentPoint]]; } diff --git a/Classes/BITAuthenticationViewController.m b/Classes/BITAuthenticationViewController.m index 3191ac7a85..e5f2f5dd11 100644 --- a/Classes/BITAuthenticationViewController.m +++ b/Classes/BITAuthenticationViewController.m @@ -143,8 +143,8 @@ } #pragma mark - UIViewController Rotation -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) __unused orientation { - return YES; +-(UIInterfaceOrientationMask)supportedInterfaceOrientations { + return UIInterfaceOrientationMaskAll; } #pragma mark - Private methods diff --git a/Classes/BITAuthenticator.m b/Classes/BITAuthenticator.m index 56330ab8f0..8df6d13136 100644 --- a/Classes/BITAuthenticator.m +++ b/Classes/BITAuthenticator.m @@ -171,7 +171,6 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44}; self.identified = YES; if (completion) { completion(YES, nil); } return; - break; case BITAuthenticatorIdentificationTypeHockeyAppUser: viewController = [[BITAuthenticationViewController alloc] initWithDelegate:self]; viewController.requirePassword = YES; @@ -680,7 +679,6 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44}; case BITAuthenticatorIdentificationTypeHockeyAppEmail: case BITAuthenticatorIdentificationTypeHockeyAppUser: return nil; - break; } NSURL *url = [self.webpageURL URLByAppendingPathComponent:[NSString stringWithFormat:@"apps/%@/authorize", self.encodedAppIdentifier]]; NSParameterAssert(whatParameter && url.absoluteString); diff --git a/Classes/BITChannel.m b/Classes/BITChannel.m index c001d587ce..7252a6b4ea 100644 --- a/Classes/BITChannel.m +++ b/Classes/BITChannel.m @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Initialisation - (instancetype)init { - if (self = [super init]) { + if ((self = [super init])) { bit_resetSafeJsonStream(&BITSafeJsonEventsString); _dataItemCount = 0; if (bit_isDebuggerAttached()) { @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN } - (instancetype)initWithTelemetryContext:(BITTelemetryContext *)telemetryContext persistence:(BITPersistence *)persistence { - if (self = [self init]) { + if ((self = [self init])) { _telemetryContext = telemetryContext; _persistence = persistence; } diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 7afd353784..54e7c444c6 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -177,7 +177,7 @@ static PLCrashReporterCallbacks plCrashCallbacks = { // C++ Exception Handler -static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInfo *info) { +static void uncaught_cxx_exception_handler(const BITCrashUncaughtCXXExceptionInfo *info) { // This relies on a LOT of sneaky internal knowledge of how PLCR works and should not be considered a long-term solution. NSGetUncaughtExceptionHandler()([[BITCrashCXXExceptionWrapperException alloc] initWithCXXExceptionInfo:info]); abort(); diff --git a/Classes/BITDomain.m b/Classes/BITDomain.m index 134b7bcfdf..d1d743af04 100644 --- a/Classes/BITDomain.m +++ b/Classes/BITDomain.m @@ -7,7 +7,7 @@ /// Initializes a new instance of the class. - (instancetype)init { - if (self = [super init]) { + if ((self = [super init])) { _envelopeTypeName = @"Microsoft.ApplicationInsights.Domain"; _dataTypeName = @"Domain"; } diff --git a/Classes/BITEnvelope.m b/Classes/BITEnvelope.m index 9f5bc0e074..b833f58f89 100644 --- a/Classes/BITEnvelope.m +++ b/Classes/BITEnvelope.m @@ -7,7 +7,7 @@ /// Initializes a new instance of the class. - (instancetype)init { - if(self = [super init]) { + if((self = [super init])) { _version = @1; _sampleRate = @100.0; _tags = [NSDictionary dictionary]; diff --git a/Classes/BITFeedbackActivity.m b/Classes/BITFeedbackActivity.m index 3af273cd22..73e7bcd19c 100644 --- a/Classes/BITFeedbackActivity.m +++ b/Classes/BITFeedbackActivity.m @@ -44,7 +44,7 @@ @interface BITFeedbackActivity() @property (nonatomic, strong) NSMutableArray *items; -@property (nonatomic, strong) UIViewController *activityViewController; +@property (nonatomic, strong, readwrite) UIViewController *activityViewController; @end diff --git a/Classes/BITFeedbackComposeViewController.m b/Classes/BITFeedbackComposeViewController.m index f6892e3e28..4ac7a374ad 100644 --- a/Classes/BITFeedbackComposeViewController.m +++ b/Classes/BITFeedbackComposeViewController.m @@ -437,8 +437,8 @@ #pragma mark - UIViewController Rotation -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) __unused orientation { - return YES; +- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ + return UIInterfaceOrientationMaskAll; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation) __unused fromInterfaceOrientation { diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 1c8365bf2f..e9b40e8e3f 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -426,11 +426,10 @@ [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration]; } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) __unused orientation { - return YES; +- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ + return UIInterfaceOrientationMaskAll; } - #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *) __unused tableView { diff --git a/Classes/BITFeedbackMessageAttachment.h b/Classes/BITFeedbackMessageAttachment.h index 6654c79437..bdfaec0085 100644 --- a/Classes/BITFeedbackMessageAttachment.h +++ b/Classes/BITFeedbackMessageAttachment.h @@ -43,7 +43,7 @@ @property (nonatomic, readonly) NSData *data; -@property (readonly) UIImage *imageRepresentation; +@property (nonatomic, readonly) UIImage *imageRepresentation; + (BITFeedbackMessageAttachment *)attachmentWithData:(NSData *)data contentType:(NSString *)contentType; diff --git a/Classes/BITFeedbackUserDataViewController.m b/Classes/BITFeedbackUserDataViewController.m index f7b93430bd..4b49a7e1ee 100644 --- a/Classes/BITFeedbackUserDataViewController.m +++ b/Classes/BITFeedbackUserDataViewController.m @@ -96,8 +96,8 @@ #pragma mark - UIViewController Rotation -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) __unused orientation { - return YES; +- (UIInterfaceOrientationMask)supportedInterfaceOrientations{ + return UIInterfaceOrientationMaskAll; } #pragma mark - Private methods diff --git a/Classes/BITHockeyAttachment.m b/Classes/BITHockeyAttachment.m index d302609bfa..283f267785 100644 --- a/Classes/BITHockeyAttachment.m +++ b/Classes/BITHockeyAttachment.m @@ -38,7 +38,7 @@ hockeyAttachmentData:(NSData *)hockeyAttachmentData contentType:(NSString *)contentType { - if (self = [super init]) { + if ((self = [super init])) { _filename = filename; _hockeyAttachmentData = hockeyAttachmentData; diff --git a/Classes/BITHockeyBaseViewController.m b/Classes/BITHockeyBaseViewController.m index ed54ced751..1632c342ce 100644 --- a/Classes/BITHockeyBaseViewController.m +++ b/Classes/BITHockeyBaseViewController.m @@ -93,21 +93,14 @@ #pragma mark - Rotation -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - BOOL shouldAutorotate; - +-(UIInterfaceOrientationMask)supportedInterfaceOrientations { if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { - shouldAutorotate = (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || - interfaceOrientation == UIInterfaceOrientationLandscapeRight || - interfaceOrientation == UIInterfaceOrientationPortrait); + return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape); } else { - shouldAutorotate = YES; + return UIInterfaceOrientationMaskAll; } - - return shouldAutorotate; } - #pragma mark - Modal presentation diff --git a/Classes/BITHockeyLogger.m b/Classes/BITHockeyLogger.m index 0952a5ab10..1a39c23dd3 100644 --- a/Classes/BITHockeyLogger.m +++ b/Classes/BITHockeyLogger.m @@ -11,7 +11,8 @@ BITLogHandler const defaultLogHandler = ^(BITLogMessageProvider messageProvider, if (_currentLogLevel < logLevel) { return; } - NSLog((@"[HockeySDK] %s/%d %@"), function, line, messageProvider()); + NSString *functionString = [NSString stringWithUTF8String:function]; + NSLog((@"[HockeySDK] %@/%d %@"), functionString, line, messageProvider()); } }; diff --git a/Classes/BITPersistence.m b/Classes/BITPersistence.m index f82a16bb08..897cd6e359 100644 --- a/Classes/BITPersistence.m +++ b/Classes/BITPersistence.m @@ -174,7 +174,7 @@ static NSUInteger const BITDefaultFileCount = 50; filePath = [self.appHockeySDKDirectoryPath stringByAppendingPathComponent:kBITMetaDataDirectory]; break; }; - default: { + case BITPersistenceTypeTelemetry: { NSString *uuid = bit_UUID(); fileName = [NSString stringWithFormat:@"%@%@", kBITFileBaseString, uuid]; filePath = [self.appHockeySDKDirectoryPath stringByAppendingPathComponent:kBITTelemetryDirectory]; diff --git a/Classes/BITSessionStateData.m b/Classes/BITSessionStateData.m index aafb40e9c9..ee755f25b7 100755 --- a/Classes/BITSessionStateData.m +++ b/Classes/BITSessionStateData.m @@ -8,7 +8,7 @@ /// Initializes a new instance of the class. - (instancetype)init { - if(self = [super init]) { + if((self = [super init])) { _envelopeTypeName = @"Microsoft.ApplicationInsights.SessionState"; _dataTypeName = @"SessionStateData"; _version = @2; diff --git a/Classes/BITTelemetryContext.m b/Classes/BITTelemetryContext.m index 0c014c019a..fb7b06c2aa 100644 --- a/Classes/BITTelemetryContext.m +++ b/Classes/BITTelemetryContext.m @@ -21,7 +21,7 @@ static char *const BITContextOperationsQueue = "net.hockeyapp.telemetryContextQu -(instancetype)init { - if(self = [super init]) { + if((self = [super init])) { _operationsQueue = dispatch_queue_create(BITContextOperationsQueue, DISPATCH_QUEUE_CONCURRENT); } return self; diff --git a/Classes/BITUpdateManager.m b/Classes/BITUpdateManager.m index c93bfabeea..4beb2d1965 100644 --- a/Classes/BITUpdateManager.m +++ b/Classes/BITUpdateManager.m @@ -817,8 +817,6 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) { case BITUpdateCheckManually: checkForUpdate = NO; break; - default: - break; } return checkForUpdate; diff --git a/Classes/BITUpdateViewController.m b/Classes/BITUpdateViewController.m index 3bde7e2524..36436087d6 100644 --- a/Classes/BITUpdateViewController.m +++ b/Classes/BITUpdateViewController.m @@ -353,12 +353,13 @@ int i = 0; BOOL breakAfterThisAppVersion = NO; - for (BITAppVersionMetaInfo *appVersion in self.updateManager.appVersions) { + BITUpdateManager *stronManager = self.updateManager; + for (BITAppVersionMetaInfo *appVersion in stronManager.appVersions) { i++; // only show the newer version of the app by default, if we don't show all versions if (!self.showAllVersions) { - if ([appVersion.version isEqualToString:[self.updateManager currentAppVersion]]) { + if ([appVersion.version isEqualToString:[stronManager currentAppVersion]]) { if (i == 1) { breakAfterThisAppVersion = YES; } else { @@ -386,12 +387,12 @@ - (void)showPreviousVersionAction { self.showAllVersions = YES; BOOL showAllPending = NO; - - for (BITAppVersionMetaInfo *appVersion in self.updateManager.appVersions) { + BITUpdateManager *strongManager = self.updateManager; + for (BITAppVersionMetaInfo *appVersion in strongManager.appVersions) { if (!showAllPending) { - if ([appVersion.version isEqualToString:[self.updateManager currentAppVersion]]) { + if ([appVersion.version isEqualToString:[strongManager currentAppVersion]]) { showAllPending = YES; - if (appVersion == self.updateManager.newestAppVersion) { + if (appVersion == strongManager.newestAppVersion) { continue; // skip this version already if it the latest version is the installed one } } else { @@ -513,12 +514,13 @@ } - (void)storeButtonFired:(BITStoreButton *) __unused button { + BITUpdateManager *strongManager = self.updateManager; switch (self.appStoreButtonState) { case AppStoreButtonStateCheck: - [self.updateManager checkForUpdateShowFeedback:YES]; + [strongManager checkForUpdateShowFeedback:YES]; break; case AppStoreButtonStateUpdate: - if ([self.updateManager initiateAppDownload]) { + if ([strongManager initiateAppDownload]) { [self setAppStoreButtonState:AppStoreButtonStateInstalling animated:YES]; }; break; diff --git a/Classes/BITWebTableViewCell.m b/Classes/BITWebTableViewCell.m index 777dd44aa5..a7dc7c810f 100644 --- a/Classes/BITWebTableViewCell.m +++ b/Classes/BITWebTableViewCell.m @@ -162,16 +162,13 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo case UIWebViewNavigationTypeLinkClicked: [self openURL:request.URL]; return NO; - break; case UIWebViewNavigationTypeOther: return YES; - break; case UIWebViewNavigationTypeBackForward: case UIWebViewNavigationTypeFormResubmitted: case UIWebViewNavigationTypeFormSubmitted: case UIWebViewNavigationTypeReload: return NO; - break; } }