diff --git a/sample/theRunAround/Classes/Session.m b/sample/theRunAround/Classes/Session.m index 1667d26e38..4a3f97a091 100644 --- a/sample/theRunAround/Classes/Session.m +++ b/sample/theRunAround/Classes/Session.m @@ -55,7 +55,7 @@ - (void) save { if ((access_token != (NSString *) [NSNull null]) && (access_token.length > 0)) { [defaults setObject:access_token forKey:@"FBAccessToken"]; } else { - [defaults removeObjectForKey:@"FBSessionKey"]; + [defaults removeObjectForKey:@"FBAccessToken"]; } NSDate *expirationDate = _facebook.expirationDate; diff --git a/src/FBDialog.m b/src/FBDialog.m index 625b10b3bf..1ab342a6c2 100644 --- a/src/FBDialog.m +++ b/src/FBDialog.m @@ -462,6 +462,9 @@ - (void)deviceOrientationDidChange:(void*)object { // UIKeyboardNotifications - (void)keyboardWillShow:(NSNotification*)notification { + + _showingKeyboard = YES; + if (FBIsDeviceIPad()) { // On the iPad the screen is large enough that we don't need to // resize the dialog to accomodate the keyboard popping up @@ -474,11 +477,11 @@ - (void)keyboardWillShow:(NSNotification*)notification { -(kPadding + kBorderWidth), -(kPadding + kBorderWidth) - _titleLabel.frame.size.height); } - - _showingKeyboard = YES; } - (void)keyboardWillHide:(NSNotification*)notification { + _showingKeyboard = NO; + if (FBIsDeviceIPad()) { return; } @@ -488,8 +491,6 @@ - (void)keyboardWillHide:(NSNotification*)notification { kPadding + kBorderWidth, kPadding + kBorderWidth + _titleLabel.frame.size.height); } - - _showingKeyboard = NO; } ////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/FBRequest.m b/src/FBRequest.m index 0ff85f12da..be0cb64909 100644 --- a/src/FBRequest.m +++ b/src/FBRequest.m @@ -175,10 +175,12 @@ - (id)parseJsonResponse:(NSData*)data error:(NSError**)error { if ([responseString isEqualToString:@"true"]) { return [NSDictionary dictionaryWithObject:@"true" forKey:@"result"]; } else if ([responseString isEqualToString:@"false"]) { - *error = [self formError:kGeneralErrorCode - userInfo:[NSDictionary - dictionaryWithObject:@"This operation can not be completed" - forKey:@"error_msg"]]; + if (error != nil) { + *error = [self formError:kGeneralErrorCode + userInfo:[NSDictionary + dictionaryWithObject:@"This operation can not be completed" + forKey:@"error_msg"]]; + } return nil; } @@ -187,22 +189,30 @@ - (id)parseJsonResponse:(NSData*)data error:(NSError**)error { if (![result isKindOfClass:[NSArray class]]) { if ([result objectForKey:@"error"] != nil) { - *error = [self formError:kGeneralErrorCode - userInfo:result]; + if (error != nil) { + *error = [self formError:kGeneralErrorCode + userInfo:result]; + } return nil; } if ([result objectForKey:@"error_code"] != nil) { - *error = [self formError:[[result objectForKey:@"error_code"] intValue] userInfo:result]; + if (error != nil) { + *error = [self formError:[[result objectForKey:@"error_code"] intValue] userInfo:result]; + } return nil; } if ([result objectForKey:@"error_msg"] != nil) { - *error = [self formError:kGeneralErrorCode userInfo:result]; + if (error != nil) { + *error = [self formError:kGeneralErrorCode userInfo:result]; + } } if ([result objectForKey:@"error_reason"] != nil) { - *error = [self formError:kGeneralErrorCode userInfo:result]; + if (error != nil) { + *error = [self formError:kGeneralErrorCode userInfo:result]; + } } } diff --git a/test/UnitTest/Classes/UnitTestViewController.m b/test/UnitTest/Classes/UnitTestViewController.m index c88459abca..e3237ed9fb 100644 --- a/test/UnitTest/Classes/UnitTestViewController.m +++ b/test/UnitTest/Classes/UnitTestViewController.m @@ -194,7 +194,7 @@ - (void) testAuthenticatedApi { dateString = [formatter stringFromDate:[NSDate date]]; [formatter release]; NSString *msg = @"Hello World"; - msg = [msg stringByAppendingFormat:dateString]; + msg = [msg stringByAppendingString:dateString]; NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: msg, @"message", @@ -216,7 +216,7 @@ - (void) testApiError { dateString = [formatter stringFromDate:[NSDate date]]; [formatter release]; NSString *msg = @"Hi World"; - msg = [msg stringByAppendingFormat:dateString]; + msg = [msg stringByAppendingString:dateString]; NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys: msg, @"message",