iosobjective-cfacebook-ios-sdkfacebook-sdk-3.14.x

IOS can't set FBProfilePictureView as the image view class


I have added an imageview on my viewcontroller using storyboard and I wanted to set the class of the image view to FBProfilePictureView but every time I did that, xcode return the class to empty, it seems that it doesn't recognized the FBProfilePictureView class, though I am able to sign in and sign out and get the user's name.

I tried to make an outlet and changed the class of the imageview to FBProfilePictureView so the outlet becomes like this:

@property (weak, nonatomic) IBOutlet FBProfilePictureView *fbImage;

However, when the user sign in, I am not able to show his/her picture, I got this exception:

2014-06-07 05:17:55.747 UITableViewControllerTutorial[1429:70b] -[UIImageView setProfileID:]: unrecognized selector sent to instance 0xab52b50

This is my code:

// This method will be called when the user information has been fetched
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
                            user:(id<FBGraphUser>)user {
    self.fbImage.profileID = user.objectID;


    self.fbName.text = user.name;
}

Note1

I already did this in AppDelegage

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [GMSServices provideAPIKey:@"AIzaSyBl6GXJ9h7yYUwjA7lv48FYCzHcvEkuzIE"];
    [FBLoginView class];
    [FBProfilePictureView class];
    return YES;
}

Note2

I don't want to add -ObjeC because the official facebook tutorial states that It could raise the app's size.

Note3

I got that exception when I log in thought when I log in, I am able to get the user's name.

Note4

I am using facebook-ios-sdk-3.14.1

Could you help please

I appreciate your time and effots

Regards,


Solution

  • I found the solution myself.

    I should have used UIView instead of ImageView

    Regards,