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;