Getting weird error
getting the following error when it tries to load in a profile pic:
Loading profile picture failed with error: Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x177a9010 {NSErrorFailingURLKey=https://graph.facebook.com/524853265/picture?sdk=ios&width=90&migration_bundle=fbsdk%3A20131015&format=json&height=90}
any ideas? It actually still ends up loading the image but the completion handler is messed up because it thinks that it failed.
According to SO this means the load was cancelled:
http://stackoverflow.com/questions/4392317/i-am-getting-this-error-nsurlerrordomain-error-999
Is it just this 1 picture or does it happen for other profile pictures too?
How are you using the view?
On Monday, November 25, 2013, cooliodoc wrote:
getting the following error when it tries to load in a profile pic:
Loading profile picture failed with error: Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0x177a9010 {NSErrorFailingURLKey= https://graph.facebook.com/524853265/picture?sdk=ios&width=90&migration_bundle=fbsdk%3A20131015&format=json&height=90 }
any ideas?
— Reply to this email directly or view it on GitHubhttps://github.com/combinatorial/DBFBProfilePictureView/issues/12 .
David Brittain [email protected]
Well I'm setting the profile ID on a callback from a friend picker
self.profilePicView.profileID = self.selectedFriend[@"id"];
self.profilePicView.pictureCropping = FBProfilePictureCroppingSquare;
and in viewDidLoad I set up the completion handlers:
self.profilePicView.emptyImage = [UIImage imageNamed:@"lbl-avitar-large.png"];
self.profilePicView.showEmptyImage = YES;
//hide the view when the download starts
self.profilePicView.startHandler = ^(DBFBProfilePictureView* view){
view.layer.opacity = 0.0f;
};
//show the view when the download completes, or show the empty image
self.profilePicView.completionHandler = ^(DBFBProfilePictureView* view, NSError* error){
if(error) {
view.showEmptyImage = YES;
view.profileID = nil;
NSLog(@"Loading profile picture failed with error: %@", error);
}
[UIView animateWithDuration:0.5f animations:^{
view.layer.opacity = 1.0f;
}];
};
And it is all profile pictures, not just this one. I'm using iOS7
Do you get the same error for every friend you pick, or is it just one in particular?
On Mon, Nov 25, 2013 at 7:45 AM, cooliodoc [email protected] wrote:
Well I'm setting the profile ID on a callback from a friend picker
self.profilePicView.profileID = self.selectedFriend[@"id"]; self.profilePicView.pictureCropping = FBProfilePictureCroppingSquare;
and in viewDidLoad I set up the completion handlers:
self.profilePicView.emptyImage = [UIImage imageNamed:@"lbl-avitar-large.png"]; self.profilePicView.showEmptyImage = YES; //hide the view when the download starts self.profilePicView.startHandler = ^(DBFBProfilePictureView* view){ view.layer.opacity = 0.0f; }; //show the view when the download completes, or show the empty image self.profilePicView.completionHandler = ^(DBFBProfilePictureView* view, NSError* error){ if(error) { view.showEmptyImage = YES; view.profileID = nil; NSLog(@"Loading profile picture failed with error: %@", error); } [UIView animateWithDuration:0.5f animations:^{ view.layer.opacity = 1.0f; }]; };— Reply to this email directly or view it on GitHubhttps://github.com/combinatorial/DBFBProfilePictureView/issues/12#issuecomment-29211928 .
David Brittain [email protected]
Like I said in my previous post :P "And it is all profile pictures, not just this one. I'm using iOS7". So yea, every friend is the same.
Sorry gmail clipped that part of the reply for some reason.
Try moving 'self.profilePicView.pictureCropping = FBProfilePictureCroppingSquare;'
Before the line where you set profileid
On Monday, November 25, 2013, cooliodoc wrote:
Like I said in my previous post :P "And it is all profile pictures, not just this one. I'm using iOS7". So yea, every friend is the same.
— Reply to this email directly or view it on GitHubhttps://github.com/combinatorial/DBFBProfilePictureView/issues/12#issuecomment-29265618 .
David Brittain [email protected]
Haha! By jove! That's it! Thanks :)