如果我使用 Facebook 方法:
[FBRequestConnection startForUploadPhoto:sendPicture
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
在下面解释的相同情况下,Facebook 并不总是接受我的 UIImage。如果我创建一个图像,如下所示:
CASE 1: UIImage *sendPicture = [UIImage imageNamed:@"f_logo.png"]
然后它确实接受我的 UIImage,但如果我创建它们的图像(在本例中,postImageView 是一个 UIImageView):
CASE 2: UIImage *sendPicture = self.postImageView.image;
然后它不接受我的 UIImage。
这里有什么问题?这是错误消息:
Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0xa06c970 {com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0xa076840 {NSErrorFailingURLStringKey=https://graph.facebook.com/me/photos?sdk=ios&access_token=BAAFZAZBNVZCfS0BACpZBJgjDz6kXZCt7t3pjiTz7rLVZAZCOXytAyReqvcuNjwJ4ntLHBrAtYodFcsoRFZBWZB5ZAzZA4w1HPLGdv1DtAevuur7yQCZC6N8gnc6U7WruoBLsN158nzTKvXa6MAZDZD&migration_bundle=fbsdk0X1.68E7002A9AC18P-98220130120&format=json, NSErrorFailingURLKey=https://graph.facebook.com/me/photos?sdk=ios&access_token=BAAFZAZBNVZCfS0BACpZBJgjDz6kXZCt7t3pjiTz7rLVZAZCOXytAyReqvcuNjwJ4ntLHBrAtYodFcsoRFZBWZB5ZAzZA4w1HPLGdv1DtAevuur7yQCZC6N8gnc6U7WruoBLsN158nzTKvXa6MAZDZD&migration_bundle=fbsdk0X1.3C8500A0449BP-85920130120&format=json, NSLocalizedDescription=The request timed out., NSUnderlyingError=0xb82a090 "The request timed out."}, com.facebook.sdk:HTTPStatusCode=200, com.facebook.sdk:ErrorSessionKey=<FBSession: 0xb85c5b0, state: FBSessionStateOpen, loginHandler: 0xb85b4b0, appID: 380400245374253, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0xb854bf0>, expirationDate: 2013-05-31 20:51:54 +0000, refreshDate: 2013-04-02 10:06:39 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
"publish_stream")>}
谢谢!