From e5de407633358b9b399b1d3b0dfc239286328d2c Mon Sep 17 00:00:00 2001 From: Diego Massanti Date: Sun, 10 Apr 2011 23:52:44 -0300 Subject: [PATCH] Minor code fixes to avoid certain compiler warnings. --- .../Sharers/Services/Facebook/FBConnect/FBDialog.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m index 1aaed9f4..f59707d1 100644 --- a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m @@ -302,7 +302,7 @@ - (id)init { #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - (id)initWithSession:(FBSession*)session { - if (self = [super initWithFrame:CGRectZero]) { + if ((self = [super initWithFrame:CGRectZero])) { _delegate = nil; _session = [session retain]; _loadingURL = nil; @@ -327,11 +327,11 @@ - (id)initWithSession:(FBSession*)session { [_closeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [_closeButton addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside]; - if ([_closeButton respondsToSelector:@selector(titleLabel)]) { - _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; - } else { // This triggers a deprecation warning but at least it will work on OS 2.x - _closeButton.font = [UIFont boldSystemFontOfSize:12]; - } +#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0 + _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; +#else + _closeButton.font = [UIFont boldSystemFontOfSize:12]; +#endif _closeButton.showsTouchWhenHighlighted = YES; _closeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;