diff --git a/src/FBDialog.m b/src/FBDialog.m index 887de3971e..2df5005fec 100644 --- a/src/FBDialog.m +++ b/src/FBDialog.m @@ -317,12 +317,15 @@ - (id)init { [_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]; - } - _closeButton.showsTouchWhenHighlighted = YES; + + // To be compatible with OS 2.x + #if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_2_2 + _closeButton.font = [UIFont boldSystemFontOfSize:12]; + #else + _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; + #endif + + _closeButton.showsTouchWhenHighlighted = YES; _closeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin; [self addSubview:_closeButton]; diff --git a/src/FBRequest.m b/src/FBRequest.m index dd6a2fbbe0..a2dafedb5e 100644 --- a/src/FBRequest.m +++ b/src/FBRequest.m @@ -268,7 +268,7 @@ - (void)connect { [request setHTTPBody:[self generatePostBody]]; } - _connection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] retain]; + _connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; }